merging some changes from the orginial repository