changed file writing and added visual timer stuff