update rege

update rege using only upper half of the matrix, but it seems hard to
make it as fast as the original one