Updated for Python 3

Used floor division for list indices