Need tips to Optimizing my code

This thread can help you.