Added a basic level and cleaned up code