added term deletion and improved form behavior