first working version
more code