crooked line function added