What makes you believe it needs optimization? If you have something which suggests it is not optimal, I'd recommend profiling the code, printing out the times it takes for certain tasks to complete -...