array functions

running and debugged