switched to two key storage for records
modified grammar to allow function calls
added function declaration check