moving prime into a lib