some js fixes
merge
small
done with stylistics