Removed some debug statements
Implemented the ternery operator