removing unnecessary indentation
replaced recursion in parseForm with for/do