Support for List and Map

Scala doesn't have a standard imperative style for loop. Instead you use this style while loop for performance reasons.