fixed lerp function