Added entity and level classes

- added classes
- small code revisions