merged Tom's changes