moved necesary function back into gui program from depricated gui functions program