new fancy ass code I wrote myself...

ps.. It’s gregg’s code