refactored the test
#108: passed unit test
#108: fixes