debugging. this is inefficient.