allowing nth to index from the end