Cleaned up code and fixed form send bug.