added documentation and messing around with javascript