Updated patch responceding to comments.