Using slice instead of direct array assignment