Improved level generator and fixed ranged bug