     for Name, properties of config.components
       name = Name[0].toLowerCase()+Name[1...]
       sb.push ""
-      sb.push "[<AllowNullLiteral>]"
-      sb.push "type #{Name}Component() ="
-      sb.push "    inherit Component()"
+      sb.push "    [<AllowNullLiteral>]"
+      sb.push "    type #{Name}Component() ="
+      sb.push "        inherit Component()"
       if properties is false 
-        sb.push "    member val active = false with get, set"
+        sb.push "        member val active = false with get, set"
       else
         for p in properties
           name = p.split(':')[0]
           value = getDefault(p.split(':')[1])
-          sb.push "    member val #{name} = #{value} with get, set"
+          sb.push "        member val #{name} = #{value} with get, set"
       
     ###
      * Systems Type Definitions

  run: (flags...) ->

    sb = []
    ex = []
    sys = {}
    
    sb.push "namespace #{config.namespace}"
    sb.push ""
    sb.push "(**"
    sb.push " * Entitas Generated Components for #{config.namespace}"
    sb.push " *"
    sb.push " * do not edit this file"
    sb.push " *)"
    sb.push ""
    sb.push "open Entitas"
    sb.push "open System"
    sb.push "open System.Collections.Generic"
    
    ex.push "module #{config.namespace}Extensions"
    ex.push ""
    ex.push "(**"
    ex.push " * Entitas Generated Extensions for #{config.namespace}"
    ex.push " *"
    ex.push " * do not edit this file"
    ex.push " *)"
    ex.push ""
    ex.push "open Entitas"
    ex.push "open #{config.namespace}"
    ex.push "open System"
    ex.push "open System.Collections.Generic"

    ###
     * Components Type Definitions

    sy.push ""
               
    ###
     * Components List
    ###
    sb.push ""
    sb.push "    type Component with "
    kc = 0
    for Name, properties of config.components
      name = Name[0].toLowerCase()+Name[1...]
      sb.push "        static member #{Name} with get() = #{++kc}"    
    sb.push "        static member TotalComponents  with get() = #{++kc}"    
    sb.push ""
  
    for Name, properties of config.components
      name = Name[0].toLowerCase()+Name[1...];
      switch properties
        when false
          s1.push "    type Entity with"     
          s1.push ""
          s1.push "        static member #{name}Component= new #{Name}Component()"
          s1.push ""
          s1.push "        member this.is#{Name}"
          s1.push "            with get() ="
          s1.push "                this.HasComponent(Component.#{Name})"
          s1.push "            and  set(value) ="
          s1.push "                if value <> this.is#{Name} then"
          s1.push "                    this.AddComponent(Component.#{Name}, Entity.#{name}Component) |> ignore"
          s1.push "                else"
          s1.push "                    this.RemoveComponent(Component.#{Name}) |> ignore"
          s1.push ""
          s1.push "        member this.Is#{Name}(value) ="
          s1.push "            this.is#{Name} <- value"
          s1.push "            this"
          s1.push ""
          s2.push "    type Matcher with "
          s2.push "        static member #{Name}"
          s2.push "            with get() = Matcher.AllOf(Component.#{Name}) "
          s2.push ""
          
        else
          s1.push "    type Entity with"
          s1.push "        member this.#{name}"
          s1.push "            with get() = this.GetComponent(Component.#{Name}):?>#{Name}Component"
          s1.push ""
          s1.push "        member this.has#{Name}"
          s1.push "            with get() = this.HasComponent(Component.#{Name})"
          s1.push ""
          s1.push "        member this._#{name}ComponentPool"
          s1.push "             with get() = new Stack<#{Name}Component>()"
          s1.push ""
          s1.push "        member this.Clear#{Name}ComponentPool() ="
          s1.push "            this._#{name}ComponentPool.Clear()"
          s1.push ""
          s1.push "        member this.Add#{Name}(#{params(properties)}) ="
          s1.push "            let mutable c = "
          s1.push "              match this._#{name}ComponentPool.Count with"
          s1.push "              | 0 -> new #{Name}Component()"
          s1.push "              | _ -> this._#{name}ComponentPool.Pop()"
          for p in properties
            s1.push "            c.#{p.split(':')[0]} <- #{p.split(':')[0]};"
          s1.push "            this.AddComponent(Component.#{Name}, c)"
          s1.push ""
          s1.push "        member this.Replace#{Name}(#{params(properties)}) ="
          s1.push "            let previousComponent = if this.has#{Name} then this.#{name} else null"
          s1.push "            let mutable c = "
          s1.push "              match this._#{name}ComponentPool.Count with"
          s1.push "              | 0 -> new #{Name}Component()"
          s1.push "              | _ -> this._#{name}ComponentPool.Pop()"
          for p in properties
            s1.push "            c.#{p.split(':')[0]} <- #{p.split(':')[0]};"
          s1.push "            this.ReplaceComponent(Component.#{Name}, c) |> ignore"
          s1.push "            if not(isNull(previousComponent)) then"
          s1.push "                this._#{name}ComponentPool.Push(previousComponent)"
          s1.push "            this"
          s1.push ""
          s1.push "        member this.Remove#{Name}() ="
          s1.push "            let c = this.#{name}"
          s1.push "            this.RemoveComponent(Component.#{Name}) |> ignore"
          s1.push "            this._#{name}ComponentPool.Push(c)"
          s1.push ""
          s2.push "    type Matcher with "
          s2.push "        static member #{Name}"
          s2.push "            with get() = Matcher.AllOf(Component.#{Name}) "
          s2.push ""
          
    ###
     * Pooled Entities
    ###
    s3.push "    type World with"
    for Name, pooled of config.entities
      if pooled
        name = Name[0].toLowerCase()+Name[1...];
        properties = config.components[Name]
        if config.components[Name] is false
          s3.push ""
          s3.push "        member this.#{name}Entity"
          s3.push "            with get() = this.GetGroup(Matcher.#{Name}).GetSingleEntity()"
          s3.push ""
          s3.push "        member this.is#{Name}"
          s3.push "            with get() ="
          s3.push "                notNull(this.#{name}Entity)"
          s3.push "            and  set(value) ="
          s3.push "                let entity = this.#{name}Entity"
          s3.push "                if value <> notNull(entity) then"
          s3.push "                    if value then"
          s3.push "                        this.CreateEntity().is#{Name} <- true"
          s3.push "                    else"
          s3.push "                        this.DestroyEntity(entity)"
          s3.push ""
        else
          s3.push ""
          s3.push "        member this.#{name}Entity"
          s3.push "            with get() = this.GetGroup(Matcher.#{Name}).GetSingleEntity()"
          s3.push ""
          s3.push "        member this.#{name}"
          s3.push "            with get() = this.#{name}Entity.#{name}"
          s3.push ""
          s3.push "        member this.has#{Name}"
          s3.push "            with get() = notNull(this.#{name}Entity)"
          s3.push ""
          s3.push "        member this.Set#{Name}(newValue) ="
          s3.push "            if this.has#{Name} then"
          s3.push "                failwith \"Single Entity Exception: #{Name}\""
          s3.push "            let entity = this.CreateEntity()"
          s3.push "            entity.Add#{Name}(newValue) |> ignore"
          s3.push "            entity"
          s3.push ""
          s3.push "        member this.Replace#{Name}(newValue) ="
          s3.push "            let entity = this.#{name}Entity"
          s3.push "            if isNull(entity) then"
          s3.push "                entity = this.Set#{Name}(newValue) |> ignore"
          s3.push "            else"
          s3.push "                entity.Replace#{Name}(newValue) |> ignore"
          s3.push "            entity"
          s3.push ""
          s3.push "        member this.Remove#{Name}() ="
          s3.push "            this.DestroyEntity(this.#{name}Entity)"
          s3.push ""
          
               
    #
    # ./<Namespace>.fs - Component declarations
    # ./Systems/*.fs - System Classes
    # ./Extensions/EntityExtensions.fs
    # ./Extensions/MatcherExtensions.fs
    # ./Extensions/WorldExtensions.fs
    #               
    mkdirp.sync path.dirname(path.join(process.cwd(), config.output.fsharp))
    mkdirp.sync path.join(process.cwd(), config.output.fsharp, "Systems")
    mkdirp.sync path.join(process.cwd(), config.output.fsharp, "Extensions")
    
    # Components
    fs.writeFileSync(path.join(process.cwd(), config.output.fsharp, 
      "Extensions/ComponentExtensions.fs"), sb.join('\n'))
    
    # Extensions
    for Name, ex of ext
      fs.writeFileSync(path.join(process.cwd(), config.output.fsharp, 
        "Extensions/#{Name}Extensions.fs"), ex.join('\n'))

    # Systems
    for Name, sy of sys
      fs.writeFileSync(path.join(process.cwd(), config.output.fsharp, 
        "Systems/#{Name}.fs"), sy.join('\n'))
      