updated to futuristicly accommodate gui functions