Added Prime gen code
Changed nearly everything