array manipulation

constructed and debugged