Tested
Removed dubugging code