Update completion.py

Some bugs in indexing and mapping numbers