more fine tuning of javascript