Code clean up

Added more comments in the source code