merged from latest ryan neufeld version