Added story of what this messy bit of code is