merged mine and Johans changes