currently debugging. Need tests