updated parser and optimizer