use as_subscript in function instead of ind2sub
Added benchmark over subscript