problem2 finished with out plotting