Apply issue 41 work-in-progress
Apply issue 41