brought branch up to date with master logic