Added some logic to parse commands and times