finished utility function :D :D