Updated recursive functions.