You can't use this for both, doubles have to use list.d(i) instead.