Fixed htmlTree() nested recursion error
Added comments