Generate meal plan (working code)

It's working, I haven't tested it extensively though.