Made javascript somewhat greener