merged from Randy's repo