Creating a custom scheduler