fix major bug in remove(), document all public API