use take instead of slice