more smooth actions in javascript