working on js code