added gui code