2nd commit from redwan

pull request from redwan