added function slices with nested loop and return number