refactoring grammar
function and var
removed errors