added ability to display battery level as a percentage
removed used variables, properly free char*