initial implementation of parser and main