modified new version, now has a GUI