proper java script