Javascript bob working