adjusting js to fit new layout