changed the createSlice method so that the optional variables are in fact optional - the function accepts null values