Added Pat's Code and Integrated It