recursive functions now work