State machine now appears to be working as intended.
Added some base for the completer to come.