Functional version I hope.
Changes required for running in docker.