recoded tourutil functions

redesigned the tourutil funtions from scratch (lol)