first attempt at a single merged script out of the previous 6