merged with marty's changes