Added comments; removed unused variables.