Adds improves logic of next_level function