corrected range computation
adjusted starting timestamp
changed to k&r code style & indentation
added computation of adjusted daily sale