reorganized everything to fit within javascript calls to container