got code up and running

odd behaviour of valgrind and cachegrind (suddenly now there are cache
misses)