I modiefied it very slightly to get the best possible results. Please use this
one for problem2. This modification will affect only problem 2 so the problem 1
data you mailed is alright.