Code cleanup/commenting/updating docstrings for the OT scripts