updated elements to use a basic state machine for mouse interaction