Check for planarity