working, inefficent, script