added corner detection