changed structure of js; added controls for filter arguments