 
 class SourceCodeScanner {
 	
-	var statementDict:[String:[StatementModel]] = Dictionary()
+	var currentProcessMode = ""
+	// statementArray contains StatementModel and String objects
+	var statementArray = [AnyObject]()
 	var parameterDict:[String:[String:String]] = Dictionary()
 	
 	private func makeNewStatementModelForProcessMode(key:String) {
-		if statementDict[key] == nil {
-			statementDict[key] = []
-		}
-		
-		if let last = statementDict[key]!.last {
+		
+		if currentProcessMode != key {
+			statementArray.append(key)
+			currentProcessMode = key
+		}
+		
+		if let last = statementArray.last as? StatementModel {
 			if last.isEmpty == true {
 				return
 			}
 		}
-		statementDict[key]!.append( StatementModel() )
+		statementArray.append( StatementModel() )
 	}
 
 	private func add(#statementItem:String, forProcessMode key:String) {
-		if statementDict[key] == nil {
+		
+		if currentProcessMode != key {
 			makeNewStatementModelForProcessMode(key)
-		} else if statementDict[key]!.isEmpty{
+		}
+		
+		statementArray.last!.add(statementItem: statementItem)
+	}
+	
+	private func addAsName(#statementItem:String, forProcessMode key:String) {
+		if currentProcessMode != key {
 			makeNewStatementModelForProcessMode(key)
 		}
 		
-		statementDict[key]!.last!.add(statementItem: statementItem)
-	}
-	
-	private func addAsName(#statementItem:String, forProcessMode key:String) {
-		if statementDict[key] == nil {
-			makeNewStatementModelForProcessMode(key)
-		} else if statementDict[key]!.isEmpty{
-			makeNewStatementModelForProcessMode(key)
-		}
-		
-		statementDict[key]!.last!.addAsName(statementItem: statementItem)
+		statementArray.last!.addAsName(statementItem: statementItem)
 	}
 	
 	private func addParameter(#parameterKey:String, parameterValue:String, forProcessMode key:String) {

		println(self.parameterDict)
		
		println("--\n\n\n--")
		println(self.statementDict)
	}
}
	func processSourceString(string:String) {
		
		parameterDict.removeAll(keepCapacity: true)
		statementArray.removeAll(keepCapacity: true)
		
		let scanner = NSScanner(string: string)
		
