code cleanup and fix level buttons again...