Writing a scheduling application