added scheduling, advanced error handling, and bug fixes