changed name of argument from space to indices to better represent what is passed in