added semantic actions
fixed merge conflicts