refactor main js, adding csv data