completed deugging--FINAL