Fixed bug. Was trying to use a float as an index