refactor and debug
rebuild, version 0.9.9