I would love to credit the person who wrote this code because it's very cool, but I don't know who that person is.