Totalling works. Messy code tho.