Project3: Added Gui controls and completed the basic algorithm