corrected spelling of entities, added package expr in files, cleaned up code a bit