Allow cwd to be passed in