gui code now organized. further improvements can be made along the way