using slices instead of plain old arrays