Bit of a mess, but problem solved!