remove unnecessary if statement
Added a few test cases