added more and new code to the Mid Term.