How can I increase the speed of my script? Is there any way to optimize it?