example of converting to array using slice