added each() method to iterate the views