added timecounting, added code style