reorganized js code; added slider (nonfunctional)