Added function to process next generation

plus 4 more test cases