added html output

added html output
bug fix

fixed runtime logic error. Output incorrec t balance