fix package name, toying with one state machine implementation
moved functions and vars around