reworked set_token function to do a lot more and set up three different functions to take advantage