converted most JS functions to CSS
simplified node numbering