Clean up some code
More cleaning
Adding comments