Handled edge cases. Changed specs as per assignment requirements