updated parser and karel code to include different end blocks