merging in changes from gridshift branch