Made my function slightly cooler.