fixed recurssive method ( lol my bad )