Removed commented code, added logging