Cleaned up code for forms based on feedback from Maria