*finished hw6, added recursive calculation and function to print result