Optimized script.
Further optimized Script.