add gamma to control threshold for add new col/row. bugfix