Removed dead code
Implemented callbacks