added function "mapWithIndex" to the Matrix module. Also implemented the "renderWorld" function