corrected Python3 slice indexing error