Way of recursion was wrong, this should be better