Added the code with updated GUI