Recursion programming exercise fromntend