Add calculating to Function