Finished implementation of the parser method