small changes
here's a version which is working