Hopefully this works on linux/osx without any modification