added more recursive functions