initial version

with some comments and bugs :-)