Removed extra print statements.
Support for "both".