finished minor debugging