merged PR from duncanbrown