added prime generation function and lazy:take(...) function