Added comments describing parameters, general cleanup