refactored code, good base to make logged users work, fixed the scroll on the clock, adding dones to the previous log not the current one