add recg function, add system tests for revg