Generator now works with multiple levels