tried a bit with original implementation