Slimmed down code in Prim's