last bit of logic