This code is getting progressively worse...