Added some clarifying comments and fixed weird indentation in this file