Gui restructured, agent logic solved for out of bound exceptions