use M.debug instead of printf
refactor, add alias for spec