added form functionality, cleaned up code, added new files to support new functionality