moved uptime to its own function