merged from laptop, should document better
lazy programer
wild idea to make a full blown finite state machine