moving to use append function for the slice