Changed to an object, bit more verbose now, but more clear in what it does.