added code to every element. Finished 2014/sept/15