added impl from flo, he could not push but sent it via email