Simplifications to level1code and added comments