added return with nested function calls with multiple parameters