Got as far as I could until reaching my first lifetime error, I'll figure it out afterwards