sorted out lots of form stuff