Python 6-10, also updated prime functions