avoided to use native array functions