index and size working