How does flagellum function within the cell