added more entities, and restructured code somewhat