previous script was incompatible with Arch. rewrote parts of the script