polished up my js