added formatting and some js