Step through each element and execute a callback function in order