removed ugly forward declarations
fixed multiple button presses