Cleaned up and added reboot function