just cleaning up some code.
tokenization is done?  I'm not sure about the border cases though, check those and see if you understand the code before moving onto the token->command parsing.