Implemented key scheduler
- have yet to debug