span() function modified