Comments added + fixes some code convention