added debug docs, refactored names