added missing string
renamed tmp vars
implemented #4