adding liniarization function