fixed up prime stuff a bit