Based on: https://bitbucket.org/danielnadeau/holographlibrary/src