fixed minor errors, though current write doesn't output the time elapsed properly