Functions substr2 added