changed bins to javascript