replace to efficient code and fix durp