added more fields to form and tidy up sqlstr