a working version

resutls are not good enough