Removed ugly polinomial criteria code