initial code, version 0.8