added an emulation of haskell's take for printing the next prime