Cleaned up and documented parser.c