Messy, but will do for now