Cleaned CTT:

- Removed commented code
- Fixed comments
- Added type signatures
- Simplified definitions