Added tests
Removed unused variable