added level generation code