Completes getPrimesArray method, tests ok