function with multiple bodies