Cleaing up code
Implementing level matrix