Putting index in right place