started error handling and added start() method to call program and
match eof at the end.