updated serial parser module to be more flexible with input