some changes following @QuLogic