getting pretty convoluted