Added comments, cleaned up code for schedule data source