still need to implement recursive approach