sub2 functionality