Added contvex hull detection