Completed Algorithm and did some printing