better html formatting, error checking