Renamed fns to functions in queue, also moved index++ around