slice and reconstruct array functions added