Finished prime() method