Changed inner workings, making this a simple script