debugging done minus the join section