adding the changes from JAmes