I was trying to make it better, but I broke it instead. The previous commit works though.