The previous version did not compile on ubuntu 16.04. I left the old version, commented, just in case.