Rewrite the uptime script to be more clear and use less libraries