added block comments and better indentation