Use Date.now()
Fix avg calculation