working through array wrapping