added form checking and ideal