slightly rearranged some lines. form errors are hidden before being removed, instead of the reverse