Requesting Help on mining code

I’ve started a little project, trying to mine ZCash with my own code. However not sure what is needed to be done to create the PoW results.

What I know so far:-.
Generate initial hash, use this has to generate 2 million numbers and save to RAM (64Mb ish of data)
Sorting, find duplicates? okay if we find duplicate we have a list of indexes, what do we do with these indexes? is it these that are sent back to the server?

If anyone has found this information on their travels could someone link me to it?

I am happy my 2 million numbers are correct, as these are the same as Nheqminer, but following the code can be difficult, so really after an overview to get me over this small step.

Thanks