Added commenting and clean up stuff