fixed warp function