corrected implementation of naive recursive approach and added more tests