diff --git a/.gitignore b/.gitignore
index ada874bb22..8e8f6449ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,6 @@ Docs/mainpage.hpp
 CMakeFiles
 */CMakeFiles
 CMakeCache.txt
+Makefile
+makefile
+data
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 015ffd7cee..eba77c3947 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,13 @@
 project(OpenMW)
 
-IF (APPLE)
-    set(APP_BUNDLE_DIR "${OpenMW_BINARY_DIR}/OpenMW.app")
+if (APPLE)
+    set(APP_BUNDLE_NAME "${CMAKE_PROJECT_NAME}.app")
+
+    set(APP_BUNDLE_DIR "${OpenMW_BINARY_DIR}/${APP_BUNDLE_NAME}")
 
     # using 10.6 sdk
     set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk")
-ENDIF (APPLE)
+endif (APPLE)
 
 # Macros
 
@@ -94,6 +96,7 @@ source_group(libs\\mangle FILES ${MANGLE_ALL})
 set(OENGINE_OGRE
   ${LIBDIR}/openengine/ogre/renderer.cpp
   ${LIBDIR}/openengine/ogre/mouselook.cpp
+  ${LIBDIR}/openengine/ogre/fader.cpp
 )
 set(OENGINE_GUI
   ${LIBDIR}/openengine/gui/events.cpp
@@ -191,7 +194,6 @@ include_directories("."
     ${OGRE_Terrain_INCLUDE_DIR}
     ${OIS_INCLUDE_DIR} ${Boost_INCLUDE_DIR}
     ${PLATFORM_INCLUDE_DIR}
-    ${CMAKE_HOME_DIRECTORY}/extern/caelum/include
     ${CMAKE_HOME_DIRECTORY}/extern/mygui_3.0.1/MyGUIEngine/include
     ${CMAKE_HOME_DIRECTORY}/extern/mygui_3.0.1/OgrePlatform/include
     ${OPENAL_INCLUDE_DIR}
@@ -201,7 +203,14 @@ include_directories("."
 
 link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR})
 
-add_subdirectory( extern/caelum )
+if(APPLE)
+    # List used Ogre plugins
+    SET(USED_OGRE_PLUGINS "RenderSystem_GL"
+                          "Plugin_OctreeSceneManager"
+                          "Plugin_CgProgramManager"
+                          "Plugin_ParticleFX")
+endif(APPLE)
+
 add_subdirectory( extern/mygui_3.0.1 )
 
 # Make sure that certain libraries are used as static libraries
@@ -211,9 +220,6 @@ add_subdirectory( extern/mygui_3.0.1 )
 # MyGUI: extern/mygui_3.0.0/
 add_definitions(-DMYGUI_STATIC)
 
-# Caelum: extern/caelum/
-add_definitions(-DCAELUM_STATIC)
-
 # Specify build paths
 
 if (APPLE)
@@ -244,32 +250,16 @@ if (APPLE)
         "${OpenMW_BINARY_DIR}/plugins.cfg")
 
     configure_file(${OpenMW_SOURCE_DIR}/files/mac/Info.plist
-        "${APP_BUNDLE_DIR}/Contents/Info.plist" COPYONLY)
+        "${APP_BUNDLE_DIR}/Contents/Info.plist")
 
     configure_file(${OpenMW_SOURCE_DIR}/files/mac/openmw.icns
         "${APP_BUNDLE_DIR}/Contents/Resources/OpenMW.icns" COPYONLY)
 
-
-    # prepare plugins
-    configure_file(${OGRE_PLUGIN_DIR}/RenderSystem_GL.dylib
-        "${APP_BUNDLE_DIR}/Contents/Plugins/RenderSystem_GL.dylib" COPYONLY)
-
-    configure_file(${OGRE_PLUGIN_DIR}/Plugin_OctreeSceneManager.dylib
-        "${APP_BUNDLE_DIR}/Contents/Plugins/Plugin_OctreeSceneManager.dylib" COPYONLY)
-
-    configure_file(${OGRE_PLUGIN_DIR}/Plugin_ParticleFX.dylib
-        "${APP_BUNDLE_DIR}/Contents/Plugins/Plugin_ParticleFX.dylib" COPYONLY)
-
-    # prepare components
-    configure_file(${OGRE_LIB_DIR}/libOgrePaging.dylib
-        "${APP_BUNDLE_DIR}/Contents/Components/libOgrePaging.dylib" COPYONLY)
-
-    configure_file(${OGRE_LIB_DIR}/libOgreTerrain.dylib
-        "${APP_BUNDLE_DIR}/Contents/Components/libOgreTerrain.dylib" COPYONLY)
-        
-    configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg
-        "${APP_BUNDLE_DIR}/Contents/MacOS/openmw.cfg")
-
+    foreach(plugin ${USED_OGRE_PLUGINS})
+        configure_file("${OGRE_PLUGIN_DIR}/${plugin}.dylib"
+                        "${APP_BUNDLE_DIR}/Contents/Plugins/${plugin}.dylib"
+                        COPYONLY)
+    endforeach()
 endif (APPLE)
 
 
@@ -279,36 +269,6 @@ if (CMAKE_COMPILER_IS_GNUCC)
     add_definitions (-Wall)
 endif (CMAKE_COMPILER_IS_GNUCC)
 
-# Apple bundling
-# TODO REWRITE!
-if (APPLE)
-    set(MISC_FILES
-        ${APP_BUNDLE_DIR}/Contents/MacOS/openmw.cfg
-        ${APP_BUNDLE_DIR}/Contents/MacOS/plugins.cfg)
-
-    set(OGRE_PLUGINS
-        ${APP_BUNDLE_DIR}/Contents/Plugins/*)
-
-install(FILES ${MISC_FILES} DESTINATION ../MacOS)
-install(DIRECTORY "${APP_BUNDLE_DIR}/Contents/Plugins" DESTINATION ..)
-install(DIRECTORY "${APP_BUNDLE_DIR}/Contents/Resources/resources" DESTINATION ../Resources)
-set(CPACK_GENERATOR "Bundle")
-set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/files/mac/Info.plist")
-set(CPACK_BUNDLE_ICON  "${CMAKE_SOURCE_DIR}/files/mac/openmw.icns")
-set(CPACK_BUNDLE_NAME "OpenMW")
-set(CPACK_PACKAGE_VERSION ${OPENMW_VERSION})
-set(CPACK_PACKAGE_VERSION_MAJOR ${OPENMW_VERSION_MAJOR})
-set(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINO})
-set(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE})
-
-include(CPack)
-
-set(CMAKE_EXE_LINKER_FLAGS "-arch i386")
-set(CMAKE_CXX_FLAGS "-arch i386")
-
-endif (APPLE)
-
-
 if(DPKG_PROGRAM)
     SET(CMAKE_INSTALL_PREFIX "/usr")
 
@@ -362,6 +322,45 @@ if(DPKG_PROGRAM)
     include(CPack)
 endif(DPKG_PROGRAM)
 
+if(WIN32)
+    FILE(GLOB files "${OpenMW_BINARY_DIR}/Release/*.*")
+    INSTALL(FILES ${files} DESTINATION ".")
+    INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" DESTINATION "." RENAME "openmw.cfg")
+    INSTALL(FILES "${OpenMW_BINARY_DIR}/launcher.cfg" "${OpenMW_BINARY_DIR}/launcher.qss" DESTINATION ".")
+    INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION ".")
+
+    SET(CPACK_GENERATOR "NSIS")
+    SET(CPACK_PACKAGE_NAME "OpenMW")
+    SET(CPACK_PACKAGE_VENDOR "OpenMW.org")
+    SET(CPACK_PACKAGE_VERSION ${OPENMW_VERSION})
+    SET(CPACK_PACKAGE_VERSION_MAJOR ${OPENMW_VERSION_MAJOR})
+    SET(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINO})
+    SET(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE})
+    SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW;esmtool;Esmtool;omwlauncher;OpenMW Launcher")
+    SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenMW_SOURCE_DIR}/readme.txt")
+    SET(CPACK_RESOURCE_FILE_LICENSE "${OpenMW_SOURCE_DIR}/GPL3.txt")
+    SET(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
+    SET(CPACK_NSIS_DISPLAY_NAME "OpenMW")
+    SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.openmw.org")
+    SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.openmw.org")
+    SET(CPACK_NSIS_INSTALLED_ICON_NAME "omwlauncher.exe")
+
+    SET(VCREDIST "${OpenMW_BINARY_DIR}/vcredist_x86.exe")
+    if(EXISTS ${VCREDIST})
+        INSTALL(FILES ${VCREDIST} DESTINATION "redist")
+        SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x86.exe\\\" /q'" )
+    endif(EXISTS ${VCREDIST})
+
+    SET(OALREDIST "${OpenMW_BINARY_DIR}/oalinst.exe")
+    if(EXISTS ${OALREDIST})
+        INSTALL(FILES ${OALREDIST} DESTINATION "redist")
+        SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
+            ExecWait '\\\"$INSTDIR\\\\redist\\\\oalinst.exe\\\" /s'" )
+    endif(EXISTS ${OALREDIST})
+
+    include(CPack)
+endif(WIN32)
+
 # Components
 add_subdirectory (components)
 
@@ -416,3 +415,86 @@ if (WIN32)
   #set_target_properties(openmw PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
   #set_target_properties(openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS")
 endif()
+
+# Apple bundling
+if (APPLE)
+    set(INSTALL_SUBDIR OpenMW)
+
+    #install(FILES ${MISC_FILES} DESTINATION ../MacOS)
+    #install(DIRECTORY "${APP_BUNDLE_DIR}/Contents/Plugins" DESTINATION ..)
+    #install(DIRECTORY "${APP_BUNDLE_DIR}/Contents/Resources/resources" DESTINATION ../Resources)
+    install(DIRECTORY "${APP_BUNDLE_DIR}" USE_SOURCE_PERMISSIONS DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
+    install(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
+    install(FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" RENAME "openmw.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
+
+    install(FILES "${OpenMW_BINARY_DIR}/plugins.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
+    install(FILES "${OpenMW_BINARY_DIR}/launcher.qss" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime)
+    set(CPACK_GENERATOR "DragNDrop")
+    # set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/files/mac/Info.plist")
+    # set(CPACK_BUNDLE_ICON  "${CMAKE_SOURCE_DIR}/files/mac/openmw.icns")
+    # set(CPACK_BUNDLE_NAME "OpenMW")
+    set(CPACK_PACKAGE_VERSION ${OPENMW_VERSION})
+    set(CPACK_PACKAGE_VERSION_MAJOR ${OPENMW_VERSION_MAJOR})
+    set(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINO})
+    set(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE})
+
+    set(APPS "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}")
+    set(PLUGINS "")
+
+    # Scan Plugins dir for *.dylibs
+    file(GLOB ALL_PLUGINS "${APP_BUNDLE_DIR}/Contents/Plugins/*.dylib")
+
+    foreach(PLUGIN ${ALL_PLUGINS})
+        get_filename_component(PLUGIN_FILENAME ${PLUGIN} NAME)
+        set(PLUGINS ${PLUGINS} "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}/Contents/Plugins/${PLUGIN_FILENAME}")
+    endforeach()
+
+    #For now, search unresolved dependencies only in default system paths, so if you put unresolveable (i.e. with @executable_path in id name) lib or framework somewhere else, it would fail
+    set(DIRS "")
+
+    # Overriding item resolving during installation, it needed if
+    # some library already has be "fixed up", i.e. its id name contains @executable_path,
+    # but library is not embedded in bundle. For example, it's Ogre.framework from Ogre SDK.
+    # Current implementation of GetPrerequsities/BundleUtilities doesn't handle that case.
+    # 
+    # Current limitations:
+    #   1. Handles only frameworks, not simple libs
+    INSTALL(CODE "
+        set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
+        set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+        set(CMAKE_SYSTEM_FRAMEWORK_PATH ${CMAKE_SYSTEM_FRAMEWORK_PATH})
+
+        set(OPENMW_RESOLVED_ITEMS \"\")
+
+        function(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
+            if(item MATCHES \"@executable_path\" AND NOT \${\${resolved_var}})
+                if (item MATCHES \"Frameworks\") # if it is a framework
+                    # get last segment of path
+                    get_filename_component(fname \"\${item}\" NAME_WE)
+                    find_library(ri NAMES \${fname} PATHS \${exepath} \${dirs} /Library/Frameworks)
+                    if (ri)
+                        message(STATUS \"found \${ri} for \${item}\")
+                        string(REGEX REPLACE \"^.*/Frameworks/.*\\\\.framework\" \"\" item_part \${item})
+                        set(ri \"\${ri}\${item_part}\")
+                        set(\${resolved_item_var} \${ri} PARENT_SCOPE)
+                        set(\${resolved_var} 1 PARENT_SCOPE)
+                        set(OPENMW_RESOLVED_ITEMS \${_OPENMW_RESOLVED_ITEMS} \${ri})
+                    endif()
+                else()
+                    # code path for standard (non-framework) libs (ogre & qt pugins)
+                endif()
+            endif()
+        endfunction(gp_resolve_item_override)
+
+        cmake_policy(SET CMP0009 OLD)
+        set(BU_CHMOD_BUNDLE_ITEMS ON)
+        include(BundleUtilities)
+        fixup_bundle(\"${APPS}\" \"${PLUGINS}\" \"${DIRS}\")
+        " COMPONENT Runtime)
+
+include(CPack)
+
+set(CMAKE_EXE_LINKER_FLAGS "-arch i386")
+set(CMAKE_CXX_FLAGS "-arch i386")
+
+endif (APPLE)
diff --git a/apps/esmtool/Makefile b/apps/esmtool/Makefile
deleted file mode 100644
index ee92cf4c84..0000000000
--- a/apps/esmtool/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-esmtool_cmd.c: esmtool.ggo
-	gengetopt < esmtool.ggo
-
-clean:
-	rm esmtool_cmd.c esmtool_cmd.h
diff --git a/apps/esmtool/esmtool_cmd.c b/apps/esmtool/esmtool_cmd.c
index d6556d9e71..3fce77de2b 100644
--- a/apps/esmtool/esmtool_cmd.c
+++ b/apps/esmtool/esmtool_cmd.c
@@ -926,13 +926,13 @@ int update_arg(void *field, char **orig_field,
                const char *long_opt, char short_opt,
                const char *additional_error)
 {
-  char *stop_char = 0;
-  const char *val = value;
-  int found;
+  //char *stop_char = 0;
+  //const char *val = value;
+  //int found;
   FIX_UNUSED (field);
 
-  stop_char = 0;
-  found = 0;
+  //stop_char = 0;
+  //found = 0;
 
   if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
     {
@@ -955,8 +955,8 @@ int update_arg(void *field, char **orig_field,
     (*prev_given)++;
   if (field_given)
     (*field_given)++;
-  if (possible_values)
-    val = possible_values[found];
+  //if (possible_values)
+    //val = possible_values[found];
 
   switch(arg_type) {
   default:
@@ -996,7 +996,7 @@ cmdline_parser_internal (
   
   int override;
   int initialize;
-  int check_required;
+  //int check_required;
   int check_ambiguity;
 
   char *optarg;
@@ -1008,7 +1008,7 @@ cmdline_parser_internal (
   
   override = params->override;
   initialize = params->initialize;
-  check_required = params->check_required;
+  //check_required = params->check_required;
   check_ambiguity = params->check_ambiguity;
 
   if (initialize)
diff --git a/apps/launcher/CMakeLists.txt b/apps/launcher/CMakeLists.txt
index 2fc3189fc0..e46a062055 100644
--- a/apps/launcher/CMakeLists.txt
+++ b/apps/launcher/CMakeLists.txt
@@ -41,14 +41,25 @@ source_group(launcher FILES ${LAUNCHER} ${LAUNCHER_HEADER} ${LAUNCHER_HEADER_MOC
 find_package(Qt4 REQUIRED)
 set(QT_USE_QTGUI 1)
 
-find_package(PNG REQUIRED)
-include_directories(${PNG_INCLUDE_DIR})
+#find_package(PNG REQUIRED)
+#include_directories(${PNG_INCLUDE_DIR})
 
 QT4_ADD_RESOURCES(RCC_SRCS resources.qrc)
 QT4_WRAP_CPP(MOC_SRCS ${LAUNCHER_HEADER_MOC})
 
 include(${QT_USE_FILE})
 
+# list here plugins that can't be detected statically, but loaded in runtime
+# it needed for packaging automatisation
+#set(USED_QT_PLUGINS imageformats/libqgif
+#                    imageformats/libqico
+#                    imageformats/libqjpeg
+#                    imageformats/libqmng
+#                    imageformats/libqsvg
+#                    imageformats/libqtga
+#                    imageformats/libqtiff)
+# It seems that launcher works without this plugins, but it loads them into memory if they exists
+
 # Main executable
 add_executable(omwlauncher
     ${LAUNCHER}
@@ -60,7 +71,7 @@ target_link_libraries(omwlauncher
     ${Boost_LIBRARIES}
     ${OGRE_LIBRARIES}
     ${QT_LIBRARIES}
-    ${PNG_LIBRARY}
+#    ${PNG_LIBRARY}
     components
 )
 
@@ -73,6 +84,13 @@ if (APPLE)
         "${APP_BUNDLE_DIR}/../launcher.qss")
     configure_file(${CMAKE_SOURCE_DIR}/files/launcher.qss
         "${APP_BUNDLE_DIR}/../launcher.cfg")
+
+    # copy used QT plugins into ${APP_BUNDLE_DIR}/Contents/Plugins
+    #foreach(PLUGIN ${USED_QT_PLUGINS})
+    #    get_filename_component(PLUGIN_FILENAME ${PLUGIN} NAME)
+    #    configure_file("${QT_PLUGINS_DIR}/${PLUGIN}.dylib" "${APP_BUNDLE_DIR}/Contents/Plugins/${PLUGIN_FILENAME}.dylib" COPYONLY)
+    #endforeach()
+
 else()
     configure_file(${CMAKE_SOURCE_DIR}/files/launcher.qss
         "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/launcher.qss")
diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt
index 8ee865a0bf..895a098672 100644
--- a/apps/openmw/CMakeLists.txt
+++ b/apps/openmw/CMakeLists.txt
@@ -1,22 +1,20 @@
-project(OpenMW)
 
 # config file
-
-configure_file ("${OpenMW_SOURCE_DIR}/config.hpp.cmake" "${OpenMW_SOURCE_DIR}/config.hpp")
+configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/config.hpp")
 
 # local files
-
 set(GAME
     main.cpp
     engine.cpp
-    )
+)
 set(GAME_HEADER
     engine.hpp
-    config.hpp)
+    config.hpp
+)
 source_group(game FILES ${GAME} ${GAME_HEADER})
 
 add_openmw_dir (mwrender
-    renderingmanager debugging sky terrain terrainmaterial player npcs creatures objects renderinginterface
+    renderingmanager debugging sky terrain terrainmaterial player animation npcanimation creatureanimation actors objects renderinginterface
     )
 
 add_openmw_dir (mwinput
@@ -25,7 +23,7 @@ add_openmw_dir (mwinput
 
 add_openmw_dir (mwgui
     layouts text_input widgets race class birth review window_manager console dialogue
-    dialogue_history window_base stats_window messagebox
+    dialogue_history window_base stats_window messagebox journalwindow charactercreation
     )
 
 add_openmw_dir (mwdialogue
@@ -36,6 +34,7 @@ add_openmw_dir (mwscript
     locals scriptmanager compilercontext interpretercontext cellextensions miscextensions
     guiextensions soundextensions skyextensions statsextensions containerextensions
     aiextensions controlextensions extensions globalscripts ref dialogueextensions
+    animationextensions
     )
 
 add_openmw_dir (mwsound
@@ -44,8 +43,8 @@ add_openmw_dir (mwsound
 
 add_openmw_dir (mwworld
     refdata world physicssystem scene environment globals class action nullaction actionteleport
-    containerstore actiontalk actiontake containerstore manualref containerutil player cellfunctors
-    cells localscripts
+    containerstore actiontalk actiontake manualref player cellfunctors
+    cells localscripts customdata weather
     )
 
 add_openmw_dir (mwclass
@@ -60,13 +59,11 @@ add_openmw_dir (mwmechanics
 # Main executable
 add_executable(openmw
     ${OPENMW_LIBS} ${OPENMW_LIBS_HEADER}
-    ${CONPONENT_FILES}
+    ${COMPONENT_FILES}
     ${OPENMW_FILES}
     ${GAME} ${GAME_HEADER}
     ${APPLE_BUNDLE_RESOURCES}
-    )
-
-target_link_libraries (openmw components)
+)
 
 # Sound stuff - here so CMake doesn't stupidly recompile EVERYTHING
 # when we change the backend.
@@ -74,27 +71,23 @@ include_directories(${SOUND_INPUT_INCLUDES} ${BULLET_INCLUDE_DIRS})
 add_definitions(${SOUND_DEFINE})
 
 target_link_libraries(openmw
-  ${OGRE_LIBRARIES}
-  ${OGRE_Terrain_LIBRARY}
-  ${OIS_LIBRARIES}
-  ${Boost_LIBRARIES}
-  ${OPENAL_LIBRARY}
-  ${SOUND_INPUT_LIBRARY}
-  ${BULLET_LIBRARIES}
-  caelum
-  MyGUIEngine
-  MyGUIOgrePlatform
+    ${OGRE_LIBRARIES}
+    ${OGRE_Terrain_LIBRARY}
+    ${OIS_LIBRARIES}
+    ${Boost_LIBRARIES}
+    ${OPENAL_LIBRARY}
+    ${SOUND_INPUT_LIBRARY}
+    ${BULLET_LIBRARIES}
+    components
+    MyGUIEngine
+    MyGUIOgrePlatform
 )
 
-if (APPLE)
+if(APPLE)
     find_library(CARBON_FRAMEWORK Carbon)
     target_link_libraries(openmw ${CARBON_FRAMEWORK})
-    install(TARGETS openmw
-        BUNDLE DESTINATION .
-        RUNTIME DESTINATION ../MacOS
-        COMPONENT Runtime)
-endif (APPLE)
+endif(APPLE)
 
 if(DPKG_PROGRAM)
     INSTALL(TARGETS openmw RUNTIME DESTINATION games COMPONENT openmw)
-endif()
+endif(DPKG_PROGRAM)
diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp
index 3ab4993963..7d65b95c55 100644
--- a/apps/openmw/engine.cpp
+++ b/apps/openmw/engine.cpp
@@ -7,6 +7,7 @@
 #include <utility>
 
 #include <OgreRoot.h>
+#include <OgreRenderWindow.h>
 
 #include <MyGUI_WidgetManager.h>
 
@@ -19,6 +20,7 @@
 #include <components/esm/esm_reader.hpp>
 #include <components/files/path.hpp>
 #include <components/nifbullet/bullet_nif_loader.hpp>
+#include <components/nifogre/ogre_nif_loader.hpp>
 
 #include "mwinput/inputmanager.hpp"
 
@@ -33,8 +35,6 @@
 #include "mwsound/soundmanager.hpp"
 
 #include "mwworld/world.hpp"
-#include "mwworld/ptr.hpp"
-#include "mwworld/environment.hpp"
 #include "mwworld/class.hpp"
 #include "mwworld/player.hpp"
 
@@ -45,6 +45,7 @@
 
 #include "mwmechanics/mechanicsmanager.hpp"
 
+
 void OMW::Engine::executeLocalScripts()
 {
     MWWorld::LocalScripts& localScripts = mEnvironment.mWorld->getLocalScripts();
@@ -99,6 +100,13 @@ void OMW::Engine::updateFocusReport (float duration)
     }
 }
 
+void OMW::Engine::setAnimationVerbose(bool animverbose){
+    if(animverbose){
+        NifOgre::NIFLoader::getSingletonPtr()->setOutputAnimFiles(true);
+        NifOgre::NIFLoader::getSingletonPtr()->setVerbosePath(mCfgMgr.getLogPath().string());
+    }
+}
+
 bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
 {
     try
@@ -115,8 +123,10 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
         }
 
         // update GUI
-        if(mShowFPS)
-            mEnvironment.mWindowManager->wmSetFPS(mOgre->getFPS());
+        Ogre::RenderWindow* window = mOgre->getWindow();
+        mEnvironment.mWindowManager->wmUpdateFps(window->getLastFPS(),
+                                                 window->getTriangleCount(),
+                                                 window->getBatchCount());
 
         mEnvironment.mWindowManager->onFrame(mEnvironment.mFrameDuration);
 
@@ -135,6 +145,7 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
             mEnvironment.mWorld->advanceTime (
                 mEnvironment.mFrameDuration*mEnvironment.mWorld->getTimeScaleFactor()/3600);
 
+
         if (changed) // keep change flag for another frame, if cell changed happend in local script
             mEnvironment.mWorld->markCellAsUnchanged();
 
@@ -145,6 +156,9 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
         if (mEnvironment.mWindowManager->getMode()==MWGui::GM_Game)
             mEnvironment.mWorld->doPhysics (movement, mEnvironment.mFrameDuration);
 
+        // update world
+        mEnvironment.mWorld->update (evt.timeSinceLastFrame);
+
         // report focus object (for debugging)
         if (mReportFocus)
             updateFocusReport (mEnvironment.mFrameDuration);
@@ -159,8 +173,7 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
 
 OMW::Engine::Engine(Cfg::ConfigurationManager& configurationManager)
   : mOgre (0)
-  , mPhysicEngine (0)
-  , mShowFPS (false)
+  , mFpsLevel(0)
   , mDebug (false)
   , mVerboseScripts (false)
   , mNewGame (false)
@@ -170,7 +183,6 @@ OMW::Engine::Engine(Cfg::ConfigurationManager& configurationManager)
   , mFocusTDiff (0)
   , mScriptManager (0)
   , mScriptContext (0)
-  , mGuiManager (0)
   , mFSStrict (false)
   , mCfgMgr(configurationManager)
 {
@@ -180,7 +192,6 @@ OMW::Engine::Engine(Cfg::ConfigurationManager& configurationManager)
 
 OMW::Engine::~Engine()
 {
-    delete mGuiManager;
     delete mEnvironment.mWorld;
     delete mEnvironment.mSoundManager;
     delete mEnvironment.mGlobalScripts;
@@ -189,7 +200,6 @@ OMW::Engine::~Engine()
     delete mEnvironment.mJournal;
     delete mScriptManager;
     delete mScriptContext;
-    delete mPhysicEngine;
     delete mOgre;
 }
 
@@ -317,25 +327,15 @@ void OMW::Engine::go()
 
     loadBSA();
 
-    /// \todo move this into the physics manager
-    // Create physics. shapeLoader is deleted by the physic engine
-    NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader();
-    mPhysicEngine = new OEngine::Physic::PhysicEngine(shapeLoader);
-
     // Create the world
-    mEnvironment.mWorld = new MWWorld::World (*mOgre, mPhysicEngine, mFileCollections, mMaster,
+    mEnvironment.mWorld = new MWWorld::World (*mOgre, mFileCollections, mMaster,
         mResDir, mNewGame, mEnvironment, mEncoding);
 
-    /// \todo move this into the GUI manager (a.k.a WindowManager)
-    // Set up the GUI system
-    mGuiManager = new OEngine::GUI::MyGUIManager(mOgre->getWindow(), mOgre->getScene(), false,
-        mCfgMgr.getLogPath().string() + std::string("/"));
-
     // Create window manager - this manages all the MW-specific GUI windows
     MWScript::registerExtensions (mExtensions);
 
-    mEnvironment.mWindowManager = new MWGui::WindowManager(mGuiManager->getGui(), mEnvironment,
-        mExtensions, mShowFPS, mNewGame);
+    mEnvironment.mWindowManager = new MWGui::WindowManager(mEnvironment,
+        mExtensions, mFpsLevel, mNewGame, mOgre, mCfgMgr.getLogPath().string() + std::string("/"));
 
     // Create sound system
     mEnvironment.mSoundManager = new MWSound::SoundManager(mOgre->getRoot(),
@@ -445,6 +445,28 @@ void OMW::Engine::activate()
     }
 }
 
+void OMW::Engine::screenshot()
+{
+    // Count screenshots.
+    int shotCount = 0;
+
+    const std::string screenshotPath = mCfgMgr.getLocalConfigPath().string();
+
+    // Find the first unused filename with a do-while
+    std::ostringstream stream;
+    do
+    {
+        // Reset the stream
+        stream.str("");
+        stream.clear();
+
+        stream << screenshotPath << "screenshot" << std::setw(3) << std::setfill('0') << shotCount++ << ".png";
+
+    } while (boost::filesystem::exists(stream.str()));
+
+    mOgre->screenshot(stream.str());
+}
+
 void OMW::Engine::setCompileAll (bool all)
 {
     mCompileAll = all;
@@ -455,9 +477,9 @@ void OMW::Engine::setSoundUsage(bool soundUsage)
     mUseSound = soundUsage;
 }
 
-void OMW::Engine::showFPS(bool showFps)
+void OMW::Engine::showFPS(int level)
 {
-    mShowFPS = showFps;
+    mFpsLevel = level;
 }
 
 void OMW::Engine::setEncoding(const std::string& encoding)
diff --git a/apps/openmw/engine.hpp b/apps/openmw/engine.hpp
index 443f790a47..00d709be40 100644
--- a/apps/openmw/engine.hpp
+++ b/apps/openmw/engine.hpp
@@ -7,8 +7,6 @@
 
 #include <OgreFrameListener.h>
 
-#include <openengine/bullet/physic.hpp>
-
 #include <components/compiler/extensions.hpp>
 #include <components/files/collections.hpp>
 #include <components/cfg/configurationmanager.hpp>
@@ -63,10 +61,9 @@ namespace OMW
             boost::filesystem::path mDataDir;
             boost::filesystem::path mResDir;
             OEngine::Render::OgreRenderer *mOgre;
-            OEngine::Physic::PhysicEngine* mPhysicEngine;
             std::string mCellName;
             std::string mMaster;
-            bool mShowFPS;
+            int mFpsLevel;
             bool mDebug;
             bool mVerboseScripts;
             bool mNewGame;
@@ -80,7 +77,7 @@ namespace OMW
             MWScript::ScriptManager *mScriptManager;
             Compiler::Extensions mExtensions;
             Compiler::Context *mScriptContext;
-            OEngine::GUI::MyGUIManager *mGuiManager;
+            
 
             Files::Collections mFileCollections;
             bool mFSStrict;
@@ -128,7 +125,7 @@ namespace OMW
             void addMaster(const std::string& master);
 
             /// Enable fps counter
-            void showFPS(bool showFps);
+            void showFPS(int level);
 
             /// Enable debug mode:
             /// - non-exclusive input
@@ -152,12 +149,17 @@ namespace OMW
             /// Activate the focussed object.
             void activate();
 
+            /// Write screenshot to file.
+            void screenshot();
+
             /// Compile all scripts (excludign dialogue scripts) at startup?
             void setCompileAll (bool all);
 
             /// Font encoding
             void setEncoding(const std::string& encoding);
 
+            void setAnimationVerbose(bool animverbose);
+
         private:
             Cfg::ConfigurationManager& mCfgMgr;
     };
diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp
index 933d1c48aa..2d0c8e44bb 100644
--- a/apps/openmw/main.cpp
+++ b/apps/openmw/main.cpp
@@ -75,8 +75,11 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Cfg::Configuratio
         ("plugin", bpo::value<StringsVector>()->default_value(StringsVector(), "")
             ->multitoken(), "plugin file(s)")
 
-        ("fps", boost::program_options::value<bool>()->implicit_value(true)
-            ->default_value(false), "show fps counter")
+        ("fps", boost::program_options::value<int>()->implicit_value(1)
+            ->default_value(0), "fps counter detail (0 = off, 1 = fps counter, 2 = full detail)")
+
+        ("anim-verbose", boost::program_options::value<bool>()->implicit_value(true)
+            ->default_value(false), "output animation indices files")
 
         ("debug", boost::program_options::value<bool>()->implicit_value(true)
             ->default_value(false), "debug mode")
@@ -200,12 +203,13 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Cfg::Configuratio
     engine.setNewGame(variables["new-game"].as<bool>());
 
     // other settings
-    engine.showFPS(variables["fps"].as<bool>());
+    engine.showFPS(variables["fps"].as<int>());
     engine.setDebugMode(variables["debug"].as<bool>());
     engine.setSoundUsage(!variables["nosound"].as<bool>());
     engine.setScriptsVerbosity(variables["script-verbose"].as<bool>());
     engine.setCompileAll(variables["script-all"].as<bool>());
     engine.setReportFocus(variables["report-focus"].as<bool>());
+    engine.setAnimationVerbose(variables["anim-verbose"].as<bool>());
 
     return true;
 }
diff --git a/apps/openmw/mwclass/apparatus.cpp b/apps/openmw/mwclass/apparatus.cpp
index 30b308e70f..da7ff86964 100644
--- a/apps/openmw/mwclass/apparatus.cpp
+++ b/apps/openmw/mwclass/apparatus.cpp
@@ -8,8 +8,7 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -20,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -58,12 +57,6 @@ namespace MWClass
             new MWWorld::ActionTake (ptr));
     }
 
-    void Apparatus::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.appas);
-    }
-
     std::string Apparatus::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Apparatus, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/apparatus.hpp b/apps/openmw/mwclass/apparatus.hpp
index 4c8a2c0e2d..86223cf604 100644
--- a/apps/openmw/mwclass/apparatus.hpp
+++ b/apps/openmw/mwclass/apparatus.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_APPARATUS_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -23,10 +22,6 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/armor.cpp b/apps/openmw/mwclass/armor.cpp
index a8a431acf3..3cdf631197 100644
--- a/apps/openmw/mwclass/armor.cpp
+++ b/apps/openmw/mwclass/armor.cpp
@@ -8,8 +8,7 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -20,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -70,12 +69,6 @@ namespace MWClass
         return ref->base->data.health;
     }
 
-    void Armor::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.armors);
-    }
-
     std::string Armor::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Armor, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/armor.hpp b/apps/openmw/mwclass/armor.hpp
index c5f9812b79..060bc364e8 100644
--- a/apps/openmw/mwclass/armor.hpp
+++ b/apps/openmw/mwclass/armor.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_ARMOR_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -29,10 +28,6 @@ namespace MWClass
             virtual int getItemMaxHealth (const MWWorld::Ptr& ptr) const;
             ///< Return item max health or throw an exception, if class does not have item health
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/book.cpp b/apps/openmw/mwclass/book.cpp
index 011fd2c320..576e521eec 100644
--- a/apps/openmw/mwclass/book.cpp
+++ b/apps/openmw/mwclass/book.cpp
@@ -8,8 +8,7 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -20,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -60,12 +59,6 @@ namespace MWClass
             new MWWorld::ActionTake (ptr));
     }
 
-    void Book::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.books);
-    }
-
     std::string Book::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Book, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/book.hpp b/apps/openmw/mwclass/book.hpp
index f0e38cceba..12dc27bb2e 100644
--- a/apps/openmw/mwclass/book.hpp
+++ b/apps/openmw/mwclass/book.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_BOOK_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -23,10 +22,6 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/clothing.cpp b/apps/openmw/mwclass/clothing.cpp
index 0214c72adf..88c43d82cb 100644
--- a/apps/openmw/mwclass/clothing.cpp
+++ b/apps/openmw/mwclass/clothing.cpp
@@ -8,8 +8,7 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -20,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -58,12 +57,6 @@ namespace MWClass
             new MWWorld::ActionTake (ptr));
     }
 
-    void Clothing::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.clothes);
-    }
-
     std::string Clothing::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/clothing.hpp b/apps/openmw/mwclass/clothing.hpp
index 76c2c4a3e4..606aba9e02 100644
--- a/apps/openmw/mwclass/clothing.hpp
+++ b/apps/openmw/mwclass/clothing.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_CLOTHING_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -23,10 +22,6 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp
index 4157ce17ad..c586069962 100644
--- a/apps/openmw/mwclass/container.cpp
+++ b/apps/openmw/mwclass/container.cpp
@@ -6,9 +6,45 @@
 #include <components/esm_store/cell_store.hpp>
 
 #include "../mwworld/ptr.hpp"
+#include "../mwworld/nullaction.hpp"
+#include "../mwworld/containerstore.hpp"
+#include "../mwworld/customdata.hpp"
+#include "../mwworld/environment.hpp"
+
+#include "../mwrender/objects.hpp"
+
+#include "../mwsound/soundmanager.hpp"
+
+namespace
+{
+    struct CustomData : public MWWorld::CustomData
+    {
+        MWWorld::ContainerStore mContainerStore;
+
+        virtual MWWorld::CustomData *clone() const;
+    };
+
+    MWWorld::CustomData *CustomData::clone() const
+    {
+        return new CustomData (*this);
+    }
+}
 
 namespace MWClass
 {
+    void Container::ensureCustomData (const MWWorld::Ptr& ptr) const
+    {
+        if (!ptr.getRefData().getCustomData())
+        {
+            std::auto_ptr<CustomData> data (new CustomData);
+
+            // \todo add initial container content
+
+            // store
+            ptr.getRefData().setCustomData (data.release());
+        }
+    }
+
     void Container::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
     {
         ESMS::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
@@ -16,7 +52,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -39,6 +75,38 @@ namespace MWClass
 
     }
 
+    boost::shared_ptr<MWWorld::Action> Container::activate (const MWWorld::Ptr& ptr,
+        const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const
+    {
+        const std::string lockedSound = "LockedChest";
+        const std::string trapActivationSound = "Disarm Trap Fail";
+
+        if (ptr.getCellRef().lockLevel>0)
+        {
+            // TODO check for key
+            std::cout << "Locked container" << std::endl;
+            environment.mSoundManager->playSound(lockedSound, 1.0, 1.0);
+            return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
+        }
+        else
+        {
+            std::cout << "Unlocked container" << std::endl;
+            if(ptr.getCellRef().trap.empty())
+            {
+                // Not trapped, Inventory GUI goes here
+                return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
+            }
+            else
+            {
+                // Trap activation goes here
+                std::cout << "Activated trap: " << ptr.getCellRef().trap << std::endl;
+                environment.mSoundManager->playSound(trapActivationSound, 1.0, 1.0);
+                ptr.getCellRef().trap = "";
+                return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
+            }
+        }
+    }
+
     std::string Container::getName (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Container, MWWorld::RefData> *ref =
@@ -47,20 +115,12 @@ namespace MWClass
         return ref->base->name;
     }
 
-    MWWorld::ContainerStore<MWWorld::RefData>& Container::getContainerStore (const MWWorld::Ptr& ptr)
+    MWWorld::ContainerStore& Container::getContainerStore (const MWWorld::Ptr& ptr)
         const
     {
-        if (!ptr.getRefData().getContainerStore().get())
-        {
-            boost::shared_ptr<MWWorld::ContainerStore<MWWorld::RefData> > store (
-                new MWWorld::ContainerStore<MWWorld::RefData>);
+        ensureCustomData (ptr);
 
-            // TODO add initial content
-
-            ptr.getRefData().getContainerStore() = store;
-        }
-
-        return *ptr.getRefData().getContainerStore();
+        return dynamic_cast<CustomData&> (*ptr.getRefData().getCustomData()).mContainerStore;
     }
 
     std::string Container::getScript (const MWWorld::Ptr& ptr) const
diff --git a/apps/openmw/mwclass/container.hpp b/apps/openmw/mwclass/container.hpp
index 01763870ad..387714176b 100644
--- a/apps/openmw/mwclass/container.hpp
+++ b/apps/openmw/mwclass/container.hpp
@@ -2,12 +2,13 @@
 #define GAME_MWCLASS_CONTAINER_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
     class Container : public MWWorld::Class
     {
+            void ensureCustomData (const MWWorld::Ptr& ptr) const;
+
         public:
 
             virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
@@ -19,8 +20,11 @@ namespace MWClass
             ///< \return name (the one that is to be presented to the user; not the internal one);
             /// can return an empty string.
 
-            virtual MWWorld::ContainerStore<MWWorld::RefData>& getContainerStore (
-                const MWWorld::Ptr& ptr) const;
+            virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
+                const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
+            ///< Generate action for activation
+
+            virtual MWWorld::ContainerStore& getContainerStore (const MWWorld::Ptr& ptr) const;
             ///< Return container store
 
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
diff --git a/apps/openmw/mwclass/containerutil.hpp b/apps/openmw/mwclass/containerutil.hpp
deleted file mode 100644
index 76bdf02361..0000000000
--- a/apps/openmw/mwclass/containerutil.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef GAME_MWCLASS_CONTAINERUTIL_H
-#define GAME_MWCLASS_CONTAINERUTIL_H
-
-#include <components/esm_store/cell_store.hpp>
-
-#include "../mwworld/ptr.hpp"
-#include "../mwworld/containerstore.hpp"
-
-namespace MWClass
-{
-    template<typename T>
-    void insertIntoContainerStore (const MWWorld::Ptr& ptr,
-        ESMS::CellRefList<T, MWWorld::RefData>& containerStore)
-    {
-        if (!ptr.isEmpty())
-        {
-            // TODO check stacking
-
-            ESMS::LiveCellRef<T, MWWorld::RefData> cellRef(ptr.getCellRef(), ptr.get<T>()->base);
-            cellRef.mData = ptr.getRefData();
-
-            containerStore.list.push_back (cellRef);
-
-        }
-    }
-}
-
-#endif
diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp
index 852701cce0..7270fd22b9 100644
--- a/apps/openmw/mwclass/creature.cpp
+++ b/apps/openmw/mwclass/creature.cpp
@@ -4,16 +4,62 @@
 #include <components/esm/loadcrea.hpp>
 
 #include "../mwmechanics/creaturestats.hpp"
+#include "../mwmechanics/mechanicsmanager.hpp"
 
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontalk.hpp"
 #include "../mwworld/environment.hpp"
+#include "../mwworld/customdata.hpp"
+#include "../mwworld/containerstore.hpp"
 
+namespace
+{
+    struct CustomData : public MWWorld::CustomData
+    {
+        MWMechanics::CreatureStats mCreatureStats;
+        MWWorld::ContainerStore mContainerStore;
 
-#include "../mwmechanics/mechanicsmanager.hpp"
+        virtual MWWorld::CustomData *clone() const;
+    };
+
+    MWWorld::CustomData *CustomData::clone() const
+    {
+        return new CustomData (*this);
+    }
+}
 
 namespace MWClass
 {
+    void Creature::ensureCustomData (const MWWorld::Ptr& ptr) const
+    {
+        if (!ptr.getRefData().getCustomData())
+        {
+            std::auto_ptr<CustomData> data (new CustomData);
+
+            ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref = ptr.get<ESM::Creature>();
+
+            // creature stats
+            data->mCreatureStats.mAttributes[0].set (ref->base->data.strength);
+            data->mCreatureStats.mAttributes[1].set (ref->base->data.intelligence);
+            data->mCreatureStats.mAttributes[2].set (ref->base->data.willpower);
+            data->mCreatureStats.mAttributes[3].set (ref->base->data.agility);
+            data->mCreatureStats.mAttributes[4].set (ref->base->data.speed);
+            data->mCreatureStats.mAttributes[5].set (ref->base->data.endurance);
+            data->mCreatureStats.mAttributes[6].set (ref->base->data.personality);
+            data->mCreatureStats.mAttributes[7].set (ref->base->data.luck);
+            data->mCreatureStats.mDynamic[0].set (ref->base->data.health);
+            data->mCreatureStats.mDynamic[1].set (ref->base->data.mana);
+            data->mCreatureStats.mDynamic[2].set (ref->base->data.fatigue);
+
+            data->mCreatureStats.mLevel = ref->base->data.level;
+
+            // \todo add initial container content
+
+            // store
+            ptr.getRefData().setCustomData (data.release());
+        }
+    }
+
     std::string Creature::getId (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
@@ -24,24 +70,12 @@ namespace MWClass
 
     void Creature::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
     {
-        /*
-        ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
-            ptr.get<ESM::Creature>();
-
-        assert (ref->base != NULL);
-        const std::string &model = ref->base->model;
-        
-        if (!model.empty())
-        {
-            MWRender::Creatures& creatures = renderingInterface.getCreatures();
-            //creatures.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
-            //creatures.insertMesh(ptr, "meshes\\" + model);
-        }*/
+        MWRender::Actors& actors = renderingInterface.getActors();
+        actors.insertCreature(ptr);
     }
 
     void Creature::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
     {
-        /*
         ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
             ptr.get<ESM::Creature>();
 
@@ -50,8 +84,7 @@ namespace MWClass
         assert (ref->base != NULL);
         if(!model.empty()){
             physics.insertActorPhysics(ptr, "meshes\\" + model);
-        }*/
-
+        }
     }
 
     void Creature::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const
@@ -74,31 +107,9 @@ namespace MWClass
 
     MWMechanics::CreatureStats& Creature::getCreatureStats (const MWWorld::Ptr& ptr) const
     {
-        if (!ptr.getRefData().getCreatureStats().get())
-        {
-            boost::shared_ptr<MWMechanics::CreatureStats> stats (
-                new MWMechanics::CreatureStats);
+        ensureCustomData (ptr);
 
-            ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref = ptr.get<ESM::Creature>();
-
-            stats->mAttributes[0].set (ref->base->data.strength);
-            stats->mAttributes[1].set (ref->base->data.intelligence);
-            stats->mAttributes[2].set (ref->base->data.willpower);
-            stats->mAttributes[3].set (ref->base->data.agility);
-            stats->mAttributes[4].set (ref->base->data.speed);
-            stats->mAttributes[5].set (ref->base->data.endurance);
-            stats->mAttributes[6].set (ref->base->data.personality);
-            stats->mAttributes[7].set (ref->base->data.luck);
-            stats->mDynamic[0].set (ref->base->data.health);
-            stats->mDynamic[1].set (ref->base->data.mana);
-            stats->mDynamic[2].set (ref->base->data.fatigue);
-
-            stats->mLevel = ref->base->data.level;
-
-            ptr.getRefData().getCreatureStats() = stats;
-        }
-
-        return *ptr.getRefData().getCreatureStats();
+        return dynamic_cast<CustomData&> (*ptr.getRefData().getCustomData()).mCreatureStats;
     }
 
     boost::shared_ptr<MWWorld::Action> Creature::activate (const MWWorld::Ptr& ptr,
@@ -107,20 +118,12 @@ namespace MWClass
         return boost::shared_ptr<MWWorld::Action> (new MWWorld::ActionTalk (ptr));
     }
 
-    MWWorld::ContainerStore<MWWorld::RefData>& Creature::getContainerStore (const MWWorld::Ptr& ptr)
+    MWWorld::ContainerStore& Creature::getContainerStore (const MWWorld::Ptr& ptr)
         const
     {
-        if (!ptr.getRefData().getContainerStore().get())
-        {
-            boost::shared_ptr<MWWorld::ContainerStore<MWWorld::RefData> > store (
-                new MWWorld::ContainerStore<MWWorld::RefData>);
+        ensureCustomData (ptr);
 
-            // TODO add initial content
-
-            ptr.getRefData().getContainerStore() = store;
-        }
-
-        return *ptr.getRefData().getContainerStore();
+        return dynamic_cast<CustomData&> (*ptr.getRefData().getCustomData()).mContainerStore;
     }
 
     std::string Creature::getScript (const MWWorld::Ptr& ptr) const
diff --git a/apps/openmw/mwclass/creature.hpp b/apps/openmw/mwclass/creature.hpp
index f74cdf9910..8eb45e8381 100644
--- a/apps/openmw/mwclass/creature.hpp
+++ b/apps/openmw/mwclass/creature.hpp
@@ -2,12 +2,16 @@
 #define GAME_MWCLASS_CREATURE_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/creatures.hpp"
+#include "../mwrender/renderinginterface.hpp"
+#include "../mwrender/actors.hpp"
+
 
 namespace MWClass
 {
     class Creature : public MWWorld::Class
     {
+            void ensureCustomData (const MWWorld::Ptr& ptr) const;
+
         public:
 
             virtual std::string getId (const MWWorld::Ptr& ptr) const;
@@ -35,7 +39,7 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual MWWorld::ContainerStore<MWWorld::RefData>& getContainerStore (
+            virtual MWWorld::ContainerStore& getContainerStore (
                 const MWWorld::Ptr& ptr) const;
             ///< Return container store
 
diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp
index 26436a0128..bd7af9597a 100644
--- a/apps/openmw/mwclass/door.cpp
+++ b/apps/openmw/mwclass/door.cpp
@@ -14,7 +14,7 @@
 
 #include "../mwrender/objects.hpp"
 
-#include <iostream>
+#include "../mwsound/soundmanager.hpp"
 
 namespace MWClass
 {
@@ -25,7 +25,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -39,13 +39,11 @@ namespace MWClass
          ESMS::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
             ptr.get<ESM::Door>();
 
-
         const std::string &model = ref->base->model;
         assert (ref->base != NULL);
         if(!model.empty()){
             physics.insertObjectPhysics(ptr, "meshes\\" + model);
         }
-
     }
 
     std::string Door::getName (const MWWorld::Ptr& ptr) const
@@ -65,15 +63,28 @@ namespace MWClass
         ESMS::LiveCellRef<ESM::Door, MWWorld::RefData> *ref =
             ptr.get<ESM::Door>();
 
+        const std::string &openSound = ref->base->openSound;
+        //const std::string &closeSound = ref->base->closeSound;
+        const std::string lockedSound = "LockedDoor";
+        const std::string trapActivationSound = "Disarm Trap Fail";
+
         if (ptr.getCellRef().lockLevel>0)
         {
             // TODO check for key
             // TODO report failure to player (message, sound?). Look up behaviour of original MW.
             std::cout << "Locked!" << std::endl;
+            environment.mSoundManager->playSound(lockedSound, 1.0, 1.0);
             return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
         }
 
-        // TODO check trap
+        if(!ptr.getCellRef().trap.empty())
+        {
+            // Trap activation
+            std::cout << "Activated trap: " << ptr.getCellRef().trap << std::endl;
+            environment.mSoundManager->playSound(trapActivationSound, 1.0, 1.0);
+            ptr.getCellRef().trap = "";
+            return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
+        }
 
         if (ref->ref.teleport)
         {
@@ -81,12 +92,13 @@ namespace MWClass
             if (environment.mWorld->getPlayer().getPlayer()==actor)
             {
                 // the player is using the door
+                environment.mSoundManager->playSound(openSound, 1.0, 1.0);
                 return boost::shared_ptr<MWWorld::Action> (
                     new MWWorld::ActionTeleportPlayer (ref->ref.destCell, ref->ref.doorDest));
             }
             else
             {
-                // another NPC or a create is using the door
+                // another NPC or a creature is using the door
                 // TODO return action for teleporting other NPC/creature
                 return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
             }
@@ -95,6 +107,9 @@ namespace MWClass
         {
             // animated door
             // TODO return action for rotating the door
+
+            // This is a little pointless, but helps with testing
+            environment.mSoundManager->playSound(openSound, 1.0, 1.0);
             return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction);
         }
     }
diff --git a/apps/openmw/mwclass/door.hpp b/apps/openmw/mwclass/door.hpp
index c230cf3576..aecb4224cc 100644
--- a/apps/openmw/mwclass/door.hpp
+++ b/apps/openmw/mwclass/door.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_DOOR_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
diff --git a/apps/openmw/mwclass/ingredient.cpp b/apps/openmw/mwclass/ingredient.cpp
index 5e55010ebf..d00e4592da 100644
--- a/apps/openmw/mwclass/ingredient.cpp
+++ b/apps/openmw/mwclass/ingredient.cpp
@@ -8,8 +8,7 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -20,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -34,14 +33,11 @@ namespace MWClass
         ESMS::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
             ptr.get<ESM::Ingredient>();
 
-
-
         const std::string &model = ref->base->model;
         assert (ref->base != NULL);
         if(!model.empty()){
             physics.insertObjectPhysics(ptr, "meshes\\" + model);
         }
-
     }
 
     std::string Ingredient::getName (const MWWorld::Ptr& ptr) const
@@ -59,12 +55,6 @@ namespace MWClass
             new MWWorld::ActionTake (ptr));
     }
 
-    void Ingredient::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.ingreds);
-    }
-
     std::string Ingredient::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Ingredient, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/ingredient.hpp b/apps/openmw/mwclass/ingredient.hpp
index 47bd1a9e5c..92d2c4eefe 100644
--- a/apps/openmw/mwclass/ingredient.hpp
+++ b/apps/openmw/mwclass/ingredient.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_INGREDIENT_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -23,10 +22,6 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/light.cpp b/apps/openmw/mwclass/light.cpp
index 3890899b0e..f9ec1c9569 100644
--- a/apps/openmw/mwclass/light.cpp
+++ b/apps/openmw/mwclass/light.cpp
@@ -12,7 +12,7 @@
 
 #include "../mwsound/soundmanager.hpp"
 
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -23,19 +23,19 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
+        MWRender::Objects& objects = renderingInterface.getObjects();
+        objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
+
         if (!model.empty())
-        {
-            MWRender::Objects& objects = renderingInterface.getObjects();
-            objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
             objects.insertMesh(ptr, "meshes\\" + model);
-            const int color = ref->base->data.color;
-            const float r = ((color >> 0) & 0xFF) / 255.0f;
-            const float g = ((color >> 8) & 0xFF) / 255.0f;
-            const float b = ((color >> 16) & 0xFF) / 255.0f;
-            const float radius = float (ref->base->data.radius);
-            objects.insertLight (ptr, r, g, b, radius);
-        }
+
+        const int color = ref->base->data.color;
+        const float r = ((color >> 0) & 0xFF) / 255.0f;
+        const float g = ((color >> 8) & 0xFF) / 255.0f;
+        const float b = ((color >> 16) & 0xFF) / 255.0f;
+        const float radius = float (ref->base->data.radius);
+        objects.insertLight (ptr, r, g, b, radius);
     }
 
     void Light::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
@@ -43,13 +43,12 @@ namespace MWClass
         ESMS::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
             ptr.get<ESM::Light>();
 
-
-        const std::string &model = ref->base->model;
         assert (ref->base != NULL);
+        const std::string &model = ref->base->model;
+
         if(!model.empty()){
             physics.insertObjectPhysics(ptr, "meshes\\" + model);
         }
-
     }
 
     void Light::enable (const MWWorld::Ptr& ptr, MWWorld::Environment& environment) const
@@ -87,12 +86,6 @@ namespace MWClass
             new MWWorld::ActionTake (ptr));
     }
 
-    void Light::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.lights);
-    }
-
     std::string Light::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/light.hpp b/apps/openmw/mwclass/light.hpp
index 34421ff513..c9940d0a59 100644
--- a/apps/openmw/mwclass/light.hpp
+++ b/apps/openmw/mwclass/light.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_LIGHT_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -28,10 +27,6 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/lockpick.cpp b/apps/openmw/mwclass/lockpick.cpp
index 636a8f0be5..98c05a1b3f 100644
--- a/apps/openmw/mwclass/lockpick.cpp
+++ b/apps/openmw/mwclass/lockpick.cpp
@@ -8,7 +8,7 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -19,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -58,12 +58,6 @@ namespace MWClass
             new MWWorld::ActionTake (ptr));
     }
 
-    void Lockpick::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.lockpicks);
-    }
-
     std::string Lockpick::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/lockpick.hpp b/apps/openmw/mwclass/lockpick.hpp
index c5f1539b4c..9cbfa0d238 100644
--- a/apps/openmw/mwclass/lockpick.hpp
+++ b/apps/openmw/mwclass/lockpick.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_LOCKPICK_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -23,10 +22,6 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/misc.cpp b/apps/openmw/mwclass/misc.cpp
index a2642d8d5b..8dde84be9b 100644
--- a/apps/openmw/mwclass/misc.cpp
+++ b/apps/openmw/mwclass/misc.cpp
@@ -8,7 +8,7 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -19,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -57,12 +57,6 @@ namespace MWClass
             new MWWorld::ActionTake (ptr));
     }
 
-    void Miscellaneous::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.miscItems);
-    }
-
     std::string Miscellaneous::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Miscellaneous, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/misc.hpp b/apps/openmw/mwclass/misc.hpp
index 36ee2c1b26..de01a64f4b 100644
--- a/apps/openmw/mwclass/misc.hpp
+++ b/apps/openmw/mwclass/misc.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_MISC_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -23,10 +22,6 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp
index cce23407fe..cc7daa83eb 100644
--- a/apps/openmw/mwclass/npc.cpp
+++ b/apps/openmw/mwclass/npc.cpp
@@ -1,27 +1,88 @@
 
 #include "npc.hpp"
 
+#include <memory>
+
+#include <OgreSceneNode.h>
+
 #include <components/esm/loadnpc.hpp>
 
 #include "../mwmechanics/creaturestats.hpp"
 #include "../mwmechanics/npcstats.hpp"
+#include "../mwmechanics/movement.hpp"
+#include "../mwmechanics/mechanicsmanager.hpp"
 
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontalk.hpp"
 #include "../mwworld/environment.hpp"
 #include "../mwworld/world.hpp"
-
-#include "../mwmechanics/mechanicsmanager.hpp"
-#include <OgreSceneNode.h>
+#include "../mwworld/containerstore.hpp"
+#include "../mwworld/customdata.hpp"
 
 namespace
 {
     const Ogre::Radian kOgrePi (Ogre::Math::PI);
     const Ogre::Radian kOgrePiOverTwo (Ogre::Math::PI / Ogre::Real(2.0));
+
+    struct CustomData : public MWWorld::CustomData
+    {
+        MWMechanics::NpcStats mNpcStats;
+        MWMechanics::CreatureStats mCreatureStats;
+        MWMechanics::Movement mMovement;
+        MWWorld::ContainerStore mContainerStore;
+
+        virtual MWWorld::CustomData *clone() const;
+    };
+
+    MWWorld::CustomData *CustomData::clone() const
+    {
+        return new CustomData (*this);
+    }
 }
 
 namespace MWClass
 {
+    void Npc::ensureCustomData (const MWWorld::Ptr& ptr) const
+    {
+        if (!ptr.getRefData().getCustomData())
+        {
+            std::auto_ptr<CustomData> data (new CustomData);
+
+            ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref = ptr.get<ESM::NPC>();
+
+            // NPC stats
+            if (!ref->base->faction.empty())
+            {
+                // TODO research how initial rank is stored. The information in loadnpc.hpp are at
+                // best very unclear.
+                data->mNpcStats.mFactionRank[ref->base->faction] = 0;
+            }
+
+            for (int i=0; i<27; ++i)
+                data->mNpcStats.mSkill[i].setBase (ref->base->npdt52.skills[i]);
+
+            // creature stats
+            data->mCreatureStats.mAttributes[0].set (ref->base->npdt52.strength);
+            data->mCreatureStats.mAttributes[1].set (ref->base->npdt52.intelligence);
+            data->mCreatureStats.mAttributes[2].set (ref->base->npdt52.willpower);
+            data->mCreatureStats.mAttributes[3].set (ref->base->npdt52.agility);
+            data->mCreatureStats.mAttributes[4].set (ref->base->npdt52.speed);
+            data->mCreatureStats.mAttributes[5].set (ref->base->npdt52.endurance);
+            data->mCreatureStats.mAttributes[6].set (ref->base->npdt52.personality);
+            data->mCreatureStats.mAttributes[7].set (ref->base->npdt52.luck);
+            data->mCreatureStats.mDynamic[0].set (ref->base->npdt52.health);
+            data->mCreatureStats.mDynamic[1].set (ref->base->npdt52.mana);
+            data->mCreatureStats.mDynamic[2].set (ref->base->npdt52.fatigue);
+
+            data->mCreatureStats.mLevel = ref->base->npdt52.level;
+
+            // \todo add initial container content
+
+            // store
+            ptr.getRefData().setCustomData (data.release());
+        }
+    }
+
     std::string Npc::getId (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
@@ -32,34 +93,28 @@ namespace MWClass
 
     void Npc::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
     {
-        /*
-        ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
-            ptr.get<ESM::NPC>();
-
-        assert (ref->base != NULL);
-        const std::string &model = ref->base->model;
-        
-        if (!model.empty())
-        {
-            MWRender::Npcs& npcs = renderingInterface.getNPCs();
-            //npcs.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
-            //npcs.insertMesh(ptr, "meshes\\" + model);
-        }*/
+        renderingInterface.getActors().insertNPC(ptr);
     }
 
     void Npc::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
     {
 
-        /*
+
         ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
             ptr.get<ESM::NPC>();
 
 
-        const std::string &model = ref->base->model;
         assert (ref->base != NULL);
-        if(!model.empty()){
-            physics.insertActorPhysics(ptr, "meshes\\" + model);
-        }*/
+		 std::string headID = ref->base->head;
+		 std::string bodyRaceID = headID.substr(0, headID.find_last_of("head_") - 4);
+		 bool beast = bodyRaceID == "b_n_khajiit_m_" || bodyRaceID == "b_n_khajiit_f_" || bodyRaceID == "b_n_argonian_m_" || bodyRaceID == "b_n_argonian_f_";
+
+
+        std::string smodel = "meshes\\base_anim.nif";
+		if(beast)
+			smodel = "meshes\\base_animkna.nif";
+		physics.insertActorPhysics(ptr, smodel);
+
 
     }
 
@@ -83,56 +138,16 @@ namespace MWClass
 
     MWMechanics::CreatureStats& Npc::getCreatureStats (const MWWorld::Ptr& ptr) const
     {
-        if (!ptr.getRefData().getCreatureStats().get())
-        {
-            boost::shared_ptr<MWMechanics::CreatureStats> stats (
-                new MWMechanics::CreatureStats);
+        ensureCustomData (ptr);
 
-            ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref = ptr.get<ESM::NPC>();
-
-            stats->mAttributes[0].set (ref->base->npdt52.strength);
-            stats->mAttributes[1].set (ref->base->npdt52.intelligence);
-            stats->mAttributes[2].set (ref->base->npdt52.willpower);
-            stats->mAttributes[3].set (ref->base->npdt52.agility);
-            stats->mAttributes[4].set (ref->base->npdt52.speed);
-            stats->mAttributes[5].set (ref->base->npdt52.endurance);
-            stats->mAttributes[6].set (ref->base->npdt52.personality);
-            stats->mAttributes[7].set (ref->base->npdt52.luck);
-            stats->mDynamic[0].set (ref->base->npdt52.health);
-            stats->mDynamic[1].set (ref->base->npdt52.mana);
-            stats->mDynamic[2].set (ref->base->npdt52.fatigue);
-
-            stats->mLevel = ref->base->npdt52.level;
-
-            ptr.getRefData().getCreatureStats() = stats;
-        }
-
-        return *ptr.getRefData().getCreatureStats();
+        return dynamic_cast<CustomData&> (*ptr.getRefData().getCustomData()).mCreatureStats;
     }
 
     MWMechanics::NpcStats& Npc::getNpcStats (const MWWorld::Ptr& ptr) const
     {
-        if (!ptr.getRefData().getNpcStats().get())
-        {
-            boost::shared_ptr<MWMechanics::NpcStats> stats (
-                new MWMechanics::NpcStats);
+        ensureCustomData (ptr);
 
-            ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref = ptr.get<ESM::NPC>();
-
-            if (!ref->base->faction.empty())
-            {
-                // TODO research how initial rank is stored. The information in loadnpc.hpp are at
-                // best very unclear.
-                stats->mFactionRank[ref->base->faction] = 0;
-            }
-
-            for (int i=0; i<27; ++i)
-                stats->mSkill[i].setBase (ref->base->npdt52.skills[i]);
-
-            ptr.getRefData().getNpcStats() = stats;
-        }
-
-        return *ptr.getRefData().getNpcStats();
+        return dynamic_cast<CustomData&> (*ptr.getRefData().getCustomData()).mNpcStats;
     }
 
     boost::shared_ptr<MWWorld::Action> Npc::activate (const MWWorld::Ptr& ptr,
@@ -141,20 +156,12 @@ namespace MWClass
         return boost::shared_ptr<MWWorld::Action> (new MWWorld::ActionTalk (ptr));
     }
 
-    MWWorld::ContainerStore<MWWorld::RefData>& Npc::getContainerStore (const MWWorld::Ptr& ptr)
+    MWWorld::ContainerStore& Npc::getContainerStore (const MWWorld::Ptr& ptr)
         const
     {
-        if (!ptr.getRefData().getContainerStore().get())
-        {
-            boost::shared_ptr<MWWorld::ContainerStore<MWWorld::RefData> > store (
-                new MWWorld::ContainerStore<MWWorld::RefData>);
+        ensureCustomData (ptr);
 
-            // TODO add initial content
-
-            ptr.getRefData().getContainerStore() = store;
-        }
-
-        return *ptr.getRefData().getContainerStore();
+        return dynamic_cast<CustomData&> (*ptr.getRefData().getCustomData()).mContainerStore;
     }
 
     std::string Npc::getScript (const MWWorld::Ptr& ptr) const
@@ -245,29 +252,20 @@ namespace MWClass
 
     MWMechanics::Movement& Npc::getMovementSettings (const MWWorld::Ptr& ptr) const
     {
-        if (!ptr.getRefData().getMovement().get())
-        {
-            boost::shared_ptr<MWMechanics::Movement> movement (
-                new MWMechanics::Movement);
+        ensureCustomData (ptr);
 
-            ptr.getRefData().getMovement() = movement;
-        }
-
-        return *ptr.getRefData().getMovement();
+        return dynamic_cast<CustomData&> (*ptr.getRefData().getCustomData()).mMovement;
     }
 
     Ogre::Vector3 Npc::getMovementVector (const MWWorld::Ptr& ptr) const
     {
         Ogre::Vector3 vector (0, 0, 0);
 
-        if (ptr.getRefData().getMovement().get())
-        {
-            vector.x = - ptr.getRefData().getMovement()->mLeftRight * 200;
-            vector.y = ptr.getRefData().getMovement()->mForwardBackward * 200;
+        vector.x = - getMovementSettings (ptr).mLeftRight * 200;
+        vector.y = getMovementSettings (ptr).mForwardBackward * 200;
 
-            if (getStance (ptr, Run, false))
-                vector *= 2;
-        }
+        if (getStance (ptr, Run, false))
+            vector *= 2;
 
         return vector;
     }
diff --git a/apps/openmw/mwclass/npc.hpp b/apps/openmw/mwclass/npc.hpp
index 271d66392d..bef417332d 100644
--- a/apps/openmw/mwclass/npc.hpp
+++ b/apps/openmw/mwclass/npc.hpp
@@ -2,12 +2,13 @@
 #define GAME_MWCLASS_NPC_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/npcs.hpp"
 
 namespace MWClass
 {
     class Npc : public MWWorld::Class
     {
+            void ensureCustomData (const MWWorld::Ptr& ptr) const;
+
         public:
 
             virtual std::string getId (const MWWorld::Ptr& ptr) const;
@@ -34,8 +35,7 @@ namespace MWClass
             virtual MWMechanics::NpcStats& getNpcStats (const MWWorld::Ptr& ptr) const;
             ///< Return NPC stats
 
-            virtual MWWorld::ContainerStore<MWWorld::RefData>& getContainerStore (
-                const MWWorld::Ptr& ptr) const;
+            virtual MWWorld::ContainerStore& getContainerStore (const MWWorld::Ptr& ptr) const;
             ///< Return container store
 
             virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
diff --git a/apps/openmw/mwclass/potion.cpp b/apps/openmw/mwclass/potion.cpp
index 86d1e2a985..c57c18fd1f 100644
--- a/apps/openmw/mwclass/potion.cpp
+++ b/apps/openmw/mwclass/potion.cpp
@@ -8,8 +8,7 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -20,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -58,12 +57,6 @@ namespace MWClass
             new MWWorld::ActionTake (ptr));
     }
 
-    void Potion::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.potions);
-    }
-
     std::string Potion::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Potion, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/potion.hpp b/apps/openmw/mwclass/potion.hpp
index 85678121fb..fd78bba539 100644
--- a/apps/openmw/mwclass/potion.hpp
+++ b/apps/openmw/mwclass/potion.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_POTION_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -23,10 +22,6 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/probe.cpp b/apps/openmw/mwclass/probe.cpp
index a09a39e661..de024e4303 100644
--- a/apps/openmw/mwclass/probe.cpp
+++ b/apps/openmw/mwclass/probe.cpp
@@ -8,7 +8,6 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-#include "containerutil.hpp"
 #include "../mwrender/objects.hpp"
 
 namespace MWClass
@@ -20,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -58,12 +57,6 @@ namespace MWClass
             new MWWorld::ActionTake (ptr));
     }
 
-    void Probe::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.probes);
-    }
-
     std::string Probe::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Probe, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/probe.hpp b/apps/openmw/mwclass/probe.hpp
index d7b9df7385..3f2bfed5be 100644
--- a/apps/openmw/mwclass/probe.hpp
+++ b/apps/openmw/mwclass/probe.hpp
@@ -3,7 +3,6 @@
 
 #include "../mwworld/class.hpp"
 
-
 namespace MWClass
 {
     class Probe : public MWWorld::Class
@@ -23,10 +22,6 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/repair.cpp b/apps/openmw/mwclass/repair.cpp
index f8755b2ebc..f831b6b503 100644
--- a/apps/openmw/mwclass/repair.cpp
+++ b/apps/openmw/mwclass/repair.cpp
@@ -8,7 +8,7 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -19,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -57,12 +57,6 @@ namespace MWClass
             new MWWorld::ActionTake (ptr));
     }
 
-    void Repair::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.repairs);
-    }
-
     std::string Repair::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Repair, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/repair.hpp b/apps/openmw/mwclass/repair.hpp
index 1e0ea51785..a5864ab35a 100644
--- a/apps/openmw/mwclass/repair.hpp
+++ b/apps/openmw/mwclass/repair.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_REPAIR_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -23,10 +22,6 @@ namespace MWClass
                 const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
             ///< Generate action for activation
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwclass/static.cpp b/apps/openmw/mwclass/static.cpp
index 946da311da..48750dd019 100644
--- a/apps/openmw/mwclass/static.cpp
+++ b/apps/openmw/mwclass/static.cpp
@@ -5,6 +5,7 @@
 
 #include "../mwworld/ptr.hpp"
 
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -15,11 +16,11 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
-            objects.insertBegin(ptr, ptr.getRefData().isEnabled(), false);
+            objects.insertBegin(ptr, ptr.getRefData().isEnabled(), true);
             objects.insertMesh(ptr, "meshes\\" + model);
         }
     }
@@ -29,13 +30,12 @@ namespace MWClass
         ESMS::LiveCellRef<ESM::Static, MWWorld::RefData> *ref =
             ptr.get<ESM::Static>();
 
-
-        const std::string &model = ref->base->model;
         assert (ref->base != NULL);
+        const std::string &model = ref->base->model;
+
         if(!model.empty()){
             physics.insertObjectPhysics(ptr, "meshes\\" + model);
         }
-
     }
 
     std::string Static::getName (const MWWorld::Ptr& ptr) const
diff --git a/apps/openmw/mwclass/static.hpp b/apps/openmw/mwclass/static.hpp
index be3fdb1804..a4b1d8c547 100644
--- a/apps/openmw/mwclass/static.hpp
+++ b/apps/openmw/mwclass/static.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_STATIC_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
diff --git a/apps/openmw/mwclass/weapon.cpp b/apps/openmw/mwclass/weapon.cpp
index 1fbd21f7cf..90fd3e33bb 100644
--- a/apps/openmw/mwclass/weapon.cpp
+++ b/apps/openmw/mwclass/weapon.cpp
@@ -8,8 +8,7 @@
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/actiontake.hpp"
 
-
-#include "containerutil.hpp"
+#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -20,7 +19,7 @@ namespace MWClass
 
         assert (ref->base != NULL);
         const std::string &model = ref->base->model;
-        
+
         if (!model.empty())
         {
             MWRender::Objects& objects = renderingInterface.getObjects();
@@ -71,12 +70,6 @@ namespace MWClass
         return ref->base->data.health;
     }
 
-    void Weapon::insertIntoContainer (const MWWorld::Ptr& ptr,
-        MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
-    {
-        insertIntoContainerStore (ptr, containerStore.weapons);
-    }
-
     std::string Weapon::getScript (const MWWorld::Ptr& ptr) const
     {
         ESMS::LiveCellRef<ESM::Weapon, MWWorld::RefData> *ref =
diff --git a/apps/openmw/mwclass/weapon.hpp b/apps/openmw/mwclass/weapon.hpp
index 79bc4d4dec..b056249b93 100644
--- a/apps/openmw/mwclass/weapon.hpp
+++ b/apps/openmw/mwclass/weapon.hpp
@@ -2,7 +2,6 @@
 #define GAME_MWCLASS_WEAPON_H
 
 #include "../mwworld/class.hpp"
-#include "../mwrender/objects.hpp"
 
 namespace MWClass
 {
@@ -29,10 +28,6 @@ namespace MWClass
             virtual int getItemMaxHealth (const MWWorld::Ptr& ptr) const;
             ///< Return item max health or throw an exception, if class does not have item health
 
-            virtual void insertIntoContainer (const MWWorld::Ptr& ptr,
-                MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const;
-            ///< Insert into a containe
-
             virtual std::string getScript (const MWWorld::Ptr& ptr) const;
             ///< Return name of the script attached to ptr
 
diff --git a/apps/openmw/mwdialogue/journalentry.cpp b/apps/openmw/mwdialogue/journalentry.cpp
index 5e9dfa674a..4eb6b8001b 100644
--- a/apps/openmw/mwdialogue/journalentry.cpp
+++ b/apps/openmw/mwdialogue/journalentry.cpp
@@ -42,7 +42,7 @@ namespace MWDialogue
             iter!=dialogue->mInfo.end(); ++iter)
             if (iter->data.disposition==index) /// \todo cleanup info structure
             {
-                iter->id;
+                return iter->id;
             }
 
         throw std::runtime_error ("unknown journal index for topic " + topic);
diff --git a/apps/openmw/mwgui/charactercreation.cpp b/apps/openmw/mwgui/charactercreation.cpp
new file mode 100644
index 0000000000..1cb0593e73
--- /dev/null
+++ b/apps/openmw/mwgui/charactercreation.cpp
@@ -0,0 +1,629 @@
+#include "charactercreation.hpp"
+
+#include "text_input.hpp"
+#include "race.hpp"
+#include "class.hpp"
+#include "birth.hpp"
+#include "review.hpp"
+#include "dialogue.hpp"
+#include "mode.hpp"
+
+namespace
+{
+    struct Step
+    {
+        const char* mText;
+        const char* mButtons[3];
+        ESM::Class::Specialization mSpecializations[3]; // The specialization for each answer
+    };
+
+    static boost::array<Step, 10> sGenerateClassSteps = { {
+        // Question 1
+        {"On a clear day you chance upon a strange animal, its legs trapped in a hunter's clawsnare. Judging from the bleeding, it will not survive long.",
+        {"Draw your dagger, mercifully endings its life with a single thrust.",
+        "Use herbs from your pack to put it to sleep.",
+        "Do not interfere in the natural evolution of events, but rather take the opportunity to learn more about a strange animal that you have never seen before."},
+        {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
+        },
+        // Question 2
+        {"One Summer afternoon your father gives you a choice of chores.",
+        {"Work in the forge with him casting iron for a new plow.",
+        "Gather herbs for your mother who is preparing dinner.",
+        "Go catch fish at the stream using a net and line."},
+        {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
+        },
+        // Question 3
+        {"Your cousin has given you a very embarrassing nickname and, even worse, likes to call you it in front of your friends. You asked him to stop, but he finds it very amusing to watch you blush.",
+        {"Beat up your cousin, then tell him that if he ever calls you that nickname again, you will bloody him worse than this time.",
+        "Make up a story that makes your nickname a badge of honor instead of something humiliating.",
+        "Make up an even more embarrassing nickname for him and use it constantly until he learns his lesson."},
+        {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
+        },
+        // Question 4
+        {"There is a lot of heated discussion at the local tavern over a grouped of people called 'Telepaths'. They have been hired by certain City-State kings. Rumor has it these Telepaths read a person's mind and tell their lord whether a follower is telling the truth or not.",
+        {"This is a terrible practice. A person's thoughts are his own and no one, not even a king, has the right to make such an invasion into another human's mind.",
+        "Loyal followers to the king have nothing to fear from a Telepath. It is important to have a method of finding assassins and spies before it is too late.",
+        "In these times, it is a necessary evil. Although you do not necessarily like the idea, a Telepath could have certain advantages during a time of war or in finding someone innocent of a crime."},
+        {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
+        },
+        // Question 5
+        {"Your mother sends you to the market with a list of goods to buy. After you finish you find that by mistake a shopkeeper has given you too much money back in exchange for one of the items.",
+        {"Return to the store and give the shopkeeper his hard-earned money, explaining to him the mistake?",
+        "Decide to put the extra money to good use and purchase items that would help your family?",
+        "Pocket the extra money, knowing that shopkeepers in general tend to overcharge customers anyway?"},
+        {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
+        },
+        // Question 6
+        {"While in the market place you witness a thief cut a purse from a noble. Even as he does so, the noble notices and calls for the city guards. In his haste to get away, the thief drops the purse near you. Surprisingly no one seems to notice the bag of coins at your feet.",
+        {"Pick up the bag and signal to the guard, knowing that the only honorable thing to do is return the money to its rightful owner.",
+        "Leave the bag there, knowing that it is better not to get involved.",
+        "Pick up the bag and pocket it, knowing that the extra windfall will help your family in times of trouble."},
+        {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
+        },
+        // Question 7
+        {"Your father sends you on a task which you loathe, cleaning the stables. On the way there, pitchfork in hand, you run into your friend from the homestead near your own. He offers to do it for you, in return for a future favor of his choosing.",
+        {"Decline his offer, knowing that your father expects you to do the work, and it is better not to be in debt.",
+        "Ask him to help you, knowing that two people can do the job faster than one, and agree to help him with one task of his choosing in the future.",
+        "Accept his offer, reasoning that as long as the stables are cleaned, it matters not who does the cleaning."},
+        {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
+        },
+        // Question 8
+        {"Your mother asks you to help fix the stove. While you are working, a very hot pipe slips its mooring and falls towards her.",
+        {"Position yourself between the pipe and your mother.",
+        "Grab the hot pipe and try to push it away.",
+        "Push your mother out of the way."},
+        {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
+        },
+        // Question 9
+        {"While in town the baker gives you a sweetroll. Delighted, you take it into an alley to enjoy only to be intercepted by a gang of three other kids your age. The leader demands the sweetroll, or else he and his friends will beat you and take it.",
+        {"Drop the sweetroll and step on it, then get ready for the fight.",
+        "Give him the sweetroll now without argument, knowing that later this afternoon you will have all your friends with you and can come and take whatever he owes you.",
+        "Act like you're going to give him the sweetroll, but at the last minute throw it in the air, hoping that they'll pay attention to it long enough for you to get a shot in on the leader."},
+        {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
+        },
+        // Question 10
+        {"Entering town you find that you are witness to a very well-dressed man running from a crowd. He screams to you for help. The crowd behind him seem very angry.",
+        {"Rush to the town's aid immediately, despite your lack of knowledge of the circumstances.",
+        "Stand aside and allow the man and the mob to pass, realizing it is probably best not to get involved.",
+        "Rush to the man's aid immediately, despite your lack of knowledge of the circumstances."},
+        {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
+        }
+    } };
+}
+
+using namespace MWGui;
+
+CharacterCreation::CharacterCreation(WindowManager* _wm, MWWorld::Environment* _environment)
+    : mNameDialog(0)
+    , mRaceDialog(0)
+    , mDialogueWindow(0)
+    , mClassChoiceDialog(0)
+    , mGenerateClassQuestionDialog(0)
+    , mGenerateClassResultDialog(0)
+    , mPickClassDialog(0)
+    , mCreateClassDialog(0)
+    , mBirthSignDialog(0)
+    , mReviewDialog(0)
+    , mWM(_wm)
+    , mEnvironment(_environment)
+{
+    mCreationStage = CSE_NotStarted;
+}
+
+void CharacterCreation::spawnDialog(const char id)
+{
+    switch (id)
+    {
+        case GM_Name:
+            if(mNameDialog)
+                mWM->removeDialog(mNameDialog);
+            mNameDialog = new TextInputDialog(*mWM);
+            mNameDialog->setTextLabel(mWM->getGameSettingString("sName", "Name"));
+            mNameDialog->setTextInput(mPlayerName);
+            mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
+            mNameDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
+            mNameDialog->open();
+            break;
+
+        case GM_Race:
+            if (mRaceDialog)
+                mWM->removeDialog(mRaceDialog);
+            mRaceDialog = new RaceDialog(*mWM);
+            mRaceDialog->setNextButtonShow(mCreationStage >= CSE_RaceChosen);
+            mRaceDialog->setRaceId(mPlayerRaceId);
+            mRaceDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
+            mRaceDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
+            mRaceDialog->open();
+            break;
+
+        case GM_Class:
+            if (mClassChoiceDialog)
+                mWM->removeDialog(mClassChoiceDialog);
+            mClassChoiceDialog = new ClassChoiceDialog(*mWM);
+            mClassChoiceDialog->eventButtonSelected = MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
+            mClassChoiceDialog->open();
+            break;
+
+        case GM_ClassPick:
+            if (mPickClassDialog)
+                mWM->removeDialog(mPickClassDialog);
+            mPickClassDialog = new PickClassDialog(*mWM);
+            mPickClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
+            mPickClassDialog->setClassId(mPlayerClass.name);
+            mPickClassDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
+            mPickClassDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
+            mPickClassDialog->open();
+            break;
+
+        case GM_Birth:
+            if (mBirthSignDialog)
+                mWM->removeDialog(mBirthSignDialog);
+            mBirthSignDialog = new BirthDialog(*mWM);
+            mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
+            mBirthSignDialog->setBirthId(mPlayerBirthSignId);
+            mBirthSignDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
+            mBirthSignDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
+            mBirthSignDialog->open();
+            break;
+
+        case GM_ClassCreate:
+            if (mCreateClassDialog)
+                mWM->removeDialog(mCreateClassDialog);
+            mCreateClassDialog = new CreateClassDialog(*mWM);
+            mCreateClassDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
+            mCreateClassDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
+            mCreateClassDialog->open();
+            break;
+        case GM_ClassGenerate:
+            mGenerateClassStep = 0;
+            mGenerateClass = "";
+            mGenerateClassSpecializations[0] = 0;
+            mGenerateClassSpecializations[1] = 0;
+            mGenerateClassSpecializations[2] = 0;
+            showClassQuestionDialog();
+            break;
+        case GM_Review:
+            if (mReviewDialog)
+                mWM->removeDialog(mReviewDialog);
+            mReviewDialog = new ReviewDialog(*mWM);
+            mReviewDialog->setPlayerName(mPlayerName);
+            mReviewDialog->setRace(mPlayerRaceId);
+            mReviewDialog->setClass(mPlayerClass);
+            mReviewDialog->setBirthSign(mPlayerBirthSignId);
+
+            mReviewDialog->setHealth(mPlayerHealth);
+            mReviewDialog->setMagicka(mPlayerMagicka);
+            mReviewDialog->setFatigue(mPlayerFatigue);
+
+            {
+                std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> >::iterator end = mPlayerAttributes.end();
+                for (std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> >::iterator it = mPlayerAttributes.begin(); it != end; ++it)
+                {
+                    mReviewDialog->setAttribute(it->first, it->second);
+                }
+            }
+
+            {
+                std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> >::iterator end = mPlayerSkillValues.end();
+                for (std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> >::iterator it = mPlayerSkillValues.begin(); it != end; ++it)
+                {
+                    mReviewDialog->setSkillValue(it->first, it->second);
+                }
+                mReviewDialog->configureSkills(mPlayerMajorSkills, mPlayerMinorSkills);
+            }
+
+            mReviewDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
+            mReviewDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
+            mReviewDialog->eventActivateDialog = MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
+            mReviewDialog->open();
+            break;
+    }
+}
+
+void CharacterCreation::setPlayerHealth (const MWMechanics::DynamicStat<int>& value)
+{
+    mPlayerHealth = value;
+}
+
+void CharacterCreation::setPlayerMagicka (const MWMechanics::DynamicStat<int>& value)
+{
+    mPlayerMagicka = value;
+}
+
+void CharacterCreation::setPlayerFatigue (const MWMechanics::DynamicStat<int>& value)
+{
+    mPlayerFatigue = value;
+}
+
+void CharacterCreation::onReviewDialogDone(WindowBase* parWindow)
+{
+    if (mReviewDialog)
+        mWM->removeDialog(mReviewDialog);
+
+    mWM->setGuiMode(GM_Game);
+}
+
+void CharacterCreation::onReviewDialogBack()
+{
+    if (mReviewDialog)
+        mWM->removeDialog(mReviewDialog);
+
+    mWM->setGuiMode(GM_Birth);
+}
+
+void CharacterCreation::onReviewActivateDialog(int parDialog)
+{
+    if (mReviewDialog)
+        mWM->removeDialog(mReviewDialog);
+    mCreationStage = CSE_ReviewNext;
+
+    switch(parDialog)
+    {
+        case ReviewDialog::NAME_DIALOG:
+            mWM->setGuiMode(GM_Name);
+            break;
+        case ReviewDialog::RACE_DIALOG:
+            mWM->setGuiMode(GM_Race);
+            break;
+        case ReviewDialog::CLASS_DIALOG:
+            mWM->setGuiMode(GM_Class);
+            break;
+        case ReviewDialog::BIRTHSIGN_DIALOG:
+            mWM->setGuiMode(GM_Birth);
+    };
+}
+
+void CharacterCreation::onPickClassDialogDone(WindowBase* parWindow)
+{
+    if (mPickClassDialog)
+    {
+        const std::string &classId = mPickClassDialog->getClassId();
+        if (!classId.empty())
+            mEnvironment->mMechanicsManager->setPlayerClass(classId);
+        const ESM::Class *klass = mEnvironment->mWorld->getStore().classes.find(classId);
+        if (klass)
+        {
+            mPlayerClass = *klass;
+            mWM->setPlayerClass(mPlayerClass);
+        }
+        mWM->removeDialog(mPickClassDialog);
+    }
+
+    //TODO This bit gets repeated a few times; wrap it in a function
+    if (mCreationStage == CSE_ReviewNext)
+        mWM->setGuiMode(GM_Review);
+    else if (mCreationStage >= CSE_ClassChosen)
+        mWM->setGuiMode(GM_Birth);
+    else
+    {
+        mCreationStage = CSE_ClassChosen;
+        mWM->setGuiMode(GM_Game);
+    }
+}
+
+void CharacterCreation::onPickClassDialogBack()
+{
+    if (mPickClassDialog)
+    {
+        const std::string classId = mPickClassDialog->getClassId();
+        if (!classId.empty())
+            mEnvironment->mMechanicsManager->setPlayerClass(classId);
+        mWM->removeDialog(mPickClassDialog);
+    }
+
+    mWM->setGuiMode(GM_Class);
+}
+
+void CharacterCreation::onClassChoice(int _index)
+{
+    if (mClassChoiceDialog)
+    {
+        mWM->removeDialog(mClassChoiceDialog);
+    }
+
+    switch(_index)
+    {
+        case ClassChoiceDialog::Class_Generate:
+            mWM->setGuiMode(GM_ClassGenerate);
+            break;
+        case ClassChoiceDialog::Class_Pick:
+            mWM->setGuiMode(GM_ClassPick);
+            break;
+        case ClassChoiceDialog::Class_Create:
+            mWM->setGuiMode(GM_ClassCreate);
+            break;
+        case ClassChoiceDialog::Class_Back:
+            mWM->setGuiMode(GM_Race);
+            break;
+
+    };
+}
+
+void CharacterCreation::onNameDialogDone(WindowBase* parWindow)
+{
+    if (mNameDialog)
+    {
+        mPlayerName = mNameDialog->getTextInput();
+        mWM->setValue("name", mPlayerName);
+        mEnvironment->mMechanicsManager->setPlayerName(mPlayerName);
+        mWM->removeDialog(mNameDialog);
+    }
+
+    if (mCreationStage == CSE_ReviewNext)
+        mWM->setGuiMode(GM_Review);
+    else if (mCreationStage >= CSE_NameChosen)
+        mWM->setGuiMode(GM_Race);
+    else
+    {
+        mCreationStage = CSE_NameChosen;
+        mWM->setGuiMode(GM_Game);
+    }
+}
+
+void CharacterCreation::onRaceDialogBack()
+{
+    if (mRaceDialog)
+    {
+        mPlayerRaceId = mRaceDialog->getRaceId();
+        if (!mPlayerRaceId.empty())
+            mEnvironment->mMechanicsManager->setPlayerRace(mPlayerRaceId, mRaceDialog->getGender() == RaceDialog::GM_Male);
+        mWM->removeDialog(mRaceDialog);
+    }
+
+    mWM->setGuiMode(GM_Name);
+}
+
+void CharacterCreation::onRaceDialogDone(WindowBase* parWindow)
+{
+    if (mRaceDialog)
+    {
+        mPlayerRaceId = mRaceDialog->getRaceId();
+        mWM->setValue("race", mPlayerRaceId);
+        if (!mPlayerRaceId.empty())
+            mEnvironment->mMechanicsManager->setPlayerRace(mPlayerRaceId, mRaceDialog->getGender() == RaceDialog::GM_Male);
+        mWM->removeDialog(mRaceDialog);
+    }
+
+    if (mCreationStage == CSE_ReviewNext)
+        mWM->setGuiMode(GM_Review);
+    else if(mCreationStage >= CSE_RaceChosen)
+        mWM->setGuiMode(GM_Class);
+    else
+    {
+        mCreationStage = CSE_RaceChosen;
+        mWM->setGuiMode(GM_Game);
+    }
+}
+
+void CharacterCreation::onBirthSignDialogDone(WindowBase* parWindow)
+{
+    if (mBirthSignDialog)
+    {
+        mPlayerBirthSignId = mBirthSignDialog->getBirthId();
+        mWM->setBirthSign(mPlayerBirthSignId);
+        if (!mPlayerBirthSignId.empty())
+            mEnvironment->mMechanicsManager->setPlayerBirthsign(mPlayerBirthSignId);
+        mWM->removeDialog(mBirthSignDialog);
+    }
+
+    if (mCreationStage >= CSE_BirthSignChosen)
+        mWM->setGuiMode(GM_Review);
+    else
+    {
+        mCreationStage = CSE_BirthSignChosen;
+        mWM->setGuiMode(GM_Game);
+    }
+}
+
+void CharacterCreation::onBirthSignDialogBack()
+{
+    if (mBirthSignDialog)
+    {
+        mEnvironment->mMechanicsManager->setPlayerBirthsign(mBirthSignDialog->getBirthId());
+        mWM->removeDialog(mBirthSignDialog);
+    }
+
+    mWM->setGuiMode(GM_Class);
+}
+
+void CharacterCreation::onCreateClassDialogDone(WindowBase* parWindow)
+{
+    if (mCreateClassDialog)
+    {
+        ESM::Class klass;
+        klass.name = mCreateClassDialog->getName();
+        klass.description = mCreateClassDialog->getDescription();
+        klass.data.specialization = mCreateClassDialog->getSpecializationId();
+        klass.data.isPlayable = 0x1;
+
+        std::vector<int> attributes = mCreateClassDialog->getFavoriteAttributes();
+        assert(attributes.size() == 2);
+        klass.data.attribute[0] = attributes[0];
+        klass.data.attribute[1] = attributes[1];
+
+        std::vector<ESM::Skill::SkillEnum> majorSkills = mCreateClassDialog->getMajorSkills();
+        std::vector<ESM::Skill::SkillEnum> minorSkills = mCreateClassDialog->getMinorSkills();
+        assert(majorSkills.size() >= sizeof(klass.data.skills)/sizeof(klass.data.skills[0]));
+        assert(minorSkills.size() >= sizeof(klass.data.skills)/sizeof(klass.data.skills[0]));
+        for (size_t i = 0; i < sizeof(klass.data.skills)/sizeof(klass.data.skills[0]); ++i)
+        {
+            klass.data.skills[i][1] = majorSkills[i];
+            klass.data.skills[i][0] = minorSkills[i];
+        }
+        mEnvironment->mMechanicsManager->setPlayerClass(klass);
+        mPlayerClass = klass;
+        mWM->setPlayerClass(klass);
+
+        mWM->removeDialog(mCreateClassDialog);
+    }
+
+    if (mCreationStage == CSE_ReviewNext)
+        mWM->setGuiMode(GM_Review);
+    else if (mCreationStage >= CSE_ClassChosen)
+        mWM->setGuiMode(GM_Birth);
+    else
+    {
+        mCreationStage = CSE_ClassChosen;
+        mWM->setGuiMode(GM_Game);
+    }
+}
+
+void CharacterCreation::onCreateClassDialogBack()
+{
+    if (mCreateClassDialog)
+        mWM->removeDialog(mCreateClassDialog);
+
+    mWM->setGuiMode(GM_Class);
+}
+
+void CharacterCreation::onClassQuestionChosen(int _index)
+{
+    if (mGenerateClassQuestionDialog)
+        mWM->removeDialog(mGenerateClassQuestionDialog);
+    if (_index < 0 || _index >= 3)
+    {
+        mWM->setGuiMode(GM_Class);
+        return;
+    }
+
+    ESM::Class::Specialization specialization = sGenerateClassSteps[mGenerateClassStep].mSpecializations[_index];
+    if (specialization == ESM::Class::Stealth)
+        ++mGenerateClassSpecializations[0];
+    else if (specialization == ESM::Class::Combat)
+        ++mGenerateClassSpecializations[1];
+    else if (specialization == ESM::Class::Magic)
+        ++mGenerateClassSpecializations[2];
+    ++mGenerateClassStep;
+    showClassQuestionDialog();
+}
+
+void CharacterCreation::showClassQuestionDialog()
+{
+    if (mGenerateClassStep == sGenerateClassSteps.size())
+    {
+        static boost::array<ClassPoint, 23> classes = { {
+            {"Acrobat",     {6, 2, 2}},
+            {"Agent",       {6, 1, 3}},
+            {"Archer",      {3, 5, 2}},
+            {"Archer",      {5, 5, 0}},
+            {"Assassin",    {6, 3, 1}},
+            {"Barbarian",   {3, 6, 1}},
+            {"Bard",        {3, 3, 3}},
+            {"Battlemage",  {1, 3, 6}},
+            {"Crusader",    {1, 6, 3}},
+            {"Healer",      {3, 1, 6}},
+            {"Knight",      {2, 6, 2}},
+            {"Monk",        {5, 3, 2}},
+            {"Nightblade",  {4, 2, 4}},
+            {"Pilgrim",     {5, 2, 3}},
+            {"Rogue",       {3, 4, 3}},
+            {"Rogue",       {4, 4, 2}},
+            {"Rogue",       {5, 4, 1}},
+            {"Scout",       {2, 5, 3}},
+            {"Sorcerer",    {2, 2, 6}},
+            {"Spellsword",  {2, 4, 4}},
+            {"Spellsword",  {5, 1, 4}},
+            {"Witchhunter", {2, 3, 5}},
+            {"Witchhunter", {5, 0, 5}}
+        } };
+
+        int match = -1;
+        for (unsigned i = 0; i < classes.size(); ++i)
+        {
+            if (mGenerateClassSpecializations[0] == classes[i].points[0] &&
+                mGenerateClassSpecializations[1] == classes[i].points[1] &&
+                mGenerateClassSpecializations[2] == classes[i].points[2])
+            {
+                match = i;
+                mGenerateClass = classes[i].id;
+                break;
+            }
+        }
+
+        if (match == -1)
+        {
+            if (mGenerateClassSpecializations[0] >= 7)
+                mGenerateClass = "Thief";
+            else if (mGenerateClassSpecializations[1] >= 7)
+                mGenerateClass = "Warrior";
+            else if (mGenerateClassSpecializations[2] >= 7)
+                mGenerateClass = "Mage";
+            else
+            {
+                std::cerr << "Failed to deduce class from chosen answers in generate class dialog" << std::endl;
+                mGenerateClass = "Thief";
+            }
+        }
+
+        if (mGenerateClassResultDialog)
+            mWM->removeDialog(mGenerateClassResultDialog);
+        mGenerateClassResultDialog = new GenerateClassResultDialog(*mWM);
+        mGenerateClassResultDialog->setClassId(mGenerateClass);
+        mGenerateClassResultDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
+        mGenerateClassResultDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
+        mGenerateClassResultDialog->open();
+        return;
+    }
+
+    if (mGenerateClassStep > sGenerateClassSteps.size())
+    {
+        mWM->setGuiMode(GM_Class);
+        return;
+    }
+
+    if (mGenerateClassQuestionDialog)
+        mWM->removeDialog(mGenerateClassQuestionDialog);
+    mGenerateClassQuestionDialog = new InfoBoxDialog(*mWM);
+
+    InfoBoxDialog::ButtonList buttons;
+    mGenerateClassQuestionDialog->setText(sGenerateClassSteps[mGenerateClassStep].mText);
+    buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[0]);
+    buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[1]);
+    buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[2]);
+    mGenerateClassQuestionDialog->setButtons(buttons);
+    mGenerateClassQuestionDialog->eventButtonSelected = MyGUI::newDelegate(this, &CharacterCreation::onClassQuestionChosen);
+    mGenerateClassQuestionDialog->open();
+}
+
+void CharacterCreation::onGenerateClassBack()
+{
+    if(mCreationStage < CSE_ClassChosen)
+        mCreationStage = CSE_ClassChosen;
+
+    if (mGenerateClassResultDialog)
+        mWM->removeDialog(mGenerateClassResultDialog);
+    mEnvironment->mMechanicsManager->setPlayerClass(mGenerateClass);
+
+    mWM->setGuiMode(GM_Class);
+}
+
+void CharacterCreation::onGenerateClassDone(WindowBase* parWindow)
+{
+    if (mGenerateClassResultDialog)
+        mWM->removeDialog(mGenerateClassResultDialog);
+    mEnvironment->mMechanicsManager->setPlayerClass(mGenerateClass);
+
+    if (mCreationStage == CSE_ReviewNext)
+        mWM->setGuiMode(GM_Review);
+    else if (mCreationStage >= CSE_ClassChosen)
+        mWM->setGuiMode(GM_Birth);
+    else
+    {
+        mCreationStage = CSE_ClassChosen;
+        mWM->setGuiMode(GM_Game);
+    }
+}
+
+CharacterCreation::~CharacterCreation()
+{
+    delete mNameDialog;
+    delete mRaceDialog;
+    delete mDialogueWindow;
+    delete mClassChoiceDialog;
+    delete mGenerateClassQuestionDialog;
+    delete mGenerateClassResultDialog;
+    delete mPickClassDialog;
+    delete mCreateClassDialog;
+    delete mBirthSignDialog;
+    delete mReviewDialog;
+}
diff --git a/apps/openmw/mwgui/charactercreation.hpp b/apps/openmw/mwgui/charactercreation.hpp
new file mode 100644
index 0000000000..b01e754d9d
--- /dev/null
+++ b/apps/openmw/mwgui/charactercreation.hpp
@@ -0,0 +1,120 @@
+#ifndef CHARACTER_CREATION_HPP
+#define CHARACTER_CREATION_HPP
+
+#include "window_manager.hpp"
+
+#include "../mwmechanics/mechanicsmanager.hpp"
+#include "../mwmechanics/stat.hpp"
+#include "../mwworld/world.hpp"
+#include <components/esm_store/store.hpp>
+
+namespace MWGui
+{
+    class WindowManager;
+    class WindowBase;
+
+    class TextInputDialog;
+    class InfoBoxDialog;
+    class RaceDialog;
+    class DialogueWindow;
+    class ClassChoiceDialog;
+    class GenerateClassResultDialog;
+    class PickClassDialog;
+    class CreateClassDialog;
+    class BirthDialog;
+    class ReviewDialog;
+    class MessageBoxManager;
+
+    class CharacterCreation
+    {
+    public:
+    typedef std::vector<int> SkillList;
+
+    CharacterCreation(WindowManager* _wm, MWWorld::Environment* _environment);
+    ~CharacterCreation();
+
+    //Show a dialog
+    void spawnDialog(const char id);
+
+    void setPlayerHealth (const MWMechanics::DynamicStat<int>& value);
+
+    void setPlayerMagicka (const MWMechanics::DynamicStat<int>& value);
+
+    void setPlayerFatigue (const MWMechanics::DynamicStat<int>& value);
+
+    private:
+    //Dialogs
+    TextInputDialog* mNameDialog;
+    RaceDialog* mRaceDialog;
+    DialogueWindow* mDialogueWindow;
+    ClassChoiceDialog* mClassChoiceDialog;
+    InfoBoxDialog* mGenerateClassQuestionDialog;
+    GenerateClassResultDialog* mGenerateClassResultDialog;
+    PickClassDialog* mPickClassDialog;
+    CreateClassDialog* mCreateClassDialog;
+    BirthDialog* mBirthSignDialog;
+    ReviewDialog* mReviewDialog;
+
+    WindowManager* mWM;
+    MWWorld::Environment* mEnvironment;
+
+    //Player data
+    std::string mPlayerName;
+    std::string mPlayerRaceId;
+    std::string mPlayerBirthSignId;
+    ESM::Class mPlayerClass;
+    std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > mPlayerAttributes;
+    SkillList mPlayerMajorSkills, mPlayerMinorSkills;
+    std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> > mPlayerSkillValues;
+    MWMechanics::DynamicStat<int> mPlayerHealth;
+    MWMechanics::DynamicStat<int> mPlayerMagicka;
+    MWMechanics::DynamicStat<int> mPlayerFatigue;
+
+    //Class generation vars
+    unsigned mGenerateClassStep;                 // Keeps track of current step in Generate Class dialog
+    unsigned mGenerateClassSpecializations[3];   // A counter for each specialization which is increased when an answer is chosen
+    std::string mGenerateClass;                  // In order: Stealth, Combat, Magic
+
+    ////Dialog events
+    //Name dialog
+    void onNameDialogDone(WindowBase* parWindow);
+
+    //Race dialog
+    void onRaceDialogDone(WindowBase* parWindow);
+    void onRaceDialogBack();
+
+    //Class dialogs
+    void onClassChoice(int _index);
+    void onPickClassDialogDone(WindowBase* parWindow);
+    void onPickClassDialogBack();
+    void onCreateClassDialogDone(WindowBase* parWindow);
+    void onCreateClassDialogBack();
+    void showClassQuestionDialog();
+    void onClassQuestionChosen(int _index);
+    void onGenerateClassBack();
+    void onGenerateClassDone(WindowBase* parWindow);
+
+    //Birthsign dialog
+    void onBirthSignDialogDone(WindowBase* parWindow);
+    void onBirthSignDialogBack();
+
+    //Review dialog
+    void onReviewDialogDone(WindowBase* parWindow);
+    void onReviewDialogBack();
+    void onReviewActivateDialog(int parDialog);
+
+    enum CSE    //Creation Stage Enum
+    {
+        CSE_NotStarted,
+        CSE_NameChosen,
+        CSE_RaceChosen,
+        CSE_ClassChosen,
+        CSE_BirthSignChosen,
+        CSE_ReviewNext
+    };
+
+    CSE mCreationStage; // Which state the character creating is in, controls back/next/ok buttons
+    };
+}
+
+#endif
diff --git a/apps/openmw/mwgui/journalwindow.cpp b/apps/openmw/mwgui/journalwindow.cpp
new file mode 100644
index 0000000000..3f3c89f39e
--- /dev/null
+++ b/apps/openmw/mwgui/journalwindow.cpp
@@ -0,0 +1,193 @@
+#include "journalwindow.hpp"
+#include "window_manager.hpp"
+#include "../mwdialogue/journal.hpp"
+#include "../mwworld/environment.hpp"
+#include "../mwworld/world.hpp"
+
+namespace
+{
+    struct book
+    {
+        int endLine;
+        std::list<std::string> pages;
+    };
+}
+
+book formatText(std::string text,book mBook,int maxLine, int lineSize)
+{
+    //stringList.push_back("");
+
+    int cLineSize = 0;
+    int cLine = mBook.endLine +1;
+    std::string cString;
+
+    if(mBook.pages.empty())
+    {
+        cString = "";
+        cLine = 0;
+    }
+    else
+    {
+        cString = mBook.pages.back() + std::string("\n");
+        mBook.pages.pop_back();
+    }
+
+    //std::string::iterator wordBegin = text.begin();
+    //std::string::iterator wordEnd;
+
+    std::string cText = text;
+
+    while(cText.length() != 0)
+    {
+        size_t firstSpace = cText.find_first_of(' ');
+        if(firstSpace == std::string::npos)
+        {
+            cString = cString + cText;
+            mBook.pages.push_back(cString);
+            //TODO:finnish this
+            break;
+        }
+        if(static_cast<int> (firstSpace) + cLineSize <= lineSize)
+        {
+            cLineSize = firstSpace + cLineSize;
+            cString = cString + cText.substr(0,firstSpace +1);
+        }
+        else
+        {
+            cLineSize = firstSpace;
+            if(cLine +1 <= maxLine)
+            {
+                cLine = cLine + 1;
+                cString = cString + std::string("\n") + cText.substr(0,firstSpace +1);
+            }
+            else
+            {
+                cLine = 0;
+                mBook.pages.push_back(cString);
+                cString = cText.substr(0,firstSpace +1);
+            }
+        }
+        //std::cout << cText << "\n";
+        //std::cout << cText.length();
+        cText = cText.substr(firstSpace +1,cText.length() - firstSpace -1);
+    }
+    mBook.endLine = cLine;
+    return mBook;
+    //std::string
+}
+
+
+MWGui::JournalWindow::JournalWindow (WindowManager& parWindowManager)
+    : WindowBase("openmw_journal_layout.xml", parWindowManager)
+    , lastPos(0)
+{
+    //setCoord(0,0,498, 342);
+    center();
+
+    getWidget(mLeftTextWidget, "LeftText");
+    getWidget(mRightTextWidget, "RightText");
+    getWidget(mPrevBtn, "PrevPageBTN");
+    mPrevBtn->eventMouseButtonClick = MyGUI::newDelegate(this,&MWGui::JournalWindow::notifyPrevPage);
+    getWidget(mNextBtn, "NextPageBTN");
+    mNextBtn->eventMouseButtonClick = MyGUI::newDelegate(this,&MWGui::JournalWindow::notifyNextPage);
+    //MyGUI::ItemBox* list = new MyGUI::ItemBox();
+    //list->addItem("qaq","aqzazaz");
+    //mScrollerWidget->addChildItem(list);
+    //mScrollerWidget->addItem("dserzt",MyGUI::UString("fedgdfg"));
+    //mEditWidget->addText("ljblsxdvdsfvgedfvdfvdkjfghldfjgn sdv,nhsxl;vvn lklksbvlksb lbsdflkbdSLKJGBLskdhbvl<kbvlqksbgkqsjhdvb");
+    //mEditWidget->show();
+    //mEditWidget->setEditStatic(true);
+    mLeftTextWidget->addText("left texxxt  ");
+    mLeftTextWidget->setEditReadOnly(true);
+    mRightTextWidget->setEditReadOnly(true);
+    mRightTextWidget->setEditStatic(true);
+    mLeftTextWidget->setEditStatic(true);
+    mRightTextWidget->addText("Right texxt  ");
+
+    //std::list<std::string> list = formatText("OpenMW rgh dsfg sqef srg ZT  uzql n ZLIEHRF LQSJH GLOIjf qjfmj hslkdgn jlkdjhg qlr isgli shli uhs fiuh qksf cg ksjnf lkqsnbf ksbf sbfkl zbf kuyzflkj sbgdfkj zlfh ozhjfmo hzmfh lizuf rty qzt ezy tkyEZT RYYJ DG fgh  is an open-source implementation of the game engine found in the game Morrowind. This is a dumb test text msodjbg smojg smoig  fiiinnn");
+    //std::list<std::string> list = formatText();
+    //displayLeftText(list.front());
+
+    MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget);
+    t->eventWindowChangeCoord = MyGUI::newDelegate(this, &JournalWindow::onWindowResize);
+}
+
+void MWGui::JournalWindow::open()
+{
+    mPageNumber = 0;
+    if(mWindowManager.getEnvironment().mJournal->begin()!=mWindowManager.getEnvironment().mJournal->end())
+    {
+        book journal;
+        journal.endLine = 0;
+
+        for(std::deque<MWDialogue::StampedJournalEntry>::const_iterator it = mWindowManager.getEnvironment().mJournal->begin();it!=mWindowManager.getEnvironment().mJournal->end();it++)
+        {
+            std::string a = it->getText(mWindowManager.getEnvironment().mWorld->getStore());
+            journal = formatText(a,journal,10,17);
+            journal.endLine = journal.endLine +1;
+            journal.pages.back() = journal.pages.back() + std::string("\n");
+        }
+        //std::string a = mWindowManager.getEnvironment().mJournal->begin()->getText(mWindowManager.getEnvironment().mWorld->getStore());
+        //std::list<std::string> journal = formatText(a,10,20,1);
+        bool left = true;
+        for(std::list<std::string>::iterator it = journal.pages.begin(); it != journal.pages.end();it++)
+        {
+            if(left)
+            {
+                leftPages.push_back(*it);
+            }
+            else
+            {
+                rightPages.push_back(*it);
+            }
+            left = !left;
+        }
+        if(!left) rightPages.push_back("");
+
+        mPageNumber = leftPages.size()-1;
+        displayLeftText(leftPages[mPageNumber]);
+        displayRightText(rightPages[mPageNumber]);
+
+    }
+    else
+    {
+        //std::cout << mWindowManager.getEnvironment().mJournal->begin()->getText(mWindowManager.getEnvironment().mWorld->getStore());
+    }
+}
+
+void MWGui::JournalWindow::onWindowResize(MyGUI::Window* window)
+{
+}
+
+void MWGui::JournalWindow::displayLeftText(std::string text)
+{
+    mLeftTextWidget->eraseText(0,mLeftTextWidget->getTextLength());
+    mLeftTextWidget->addText(text);
+}
+
+void MWGui::JournalWindow::displayRightText(std::string text)
+{
+    mRightTextWidget->eraseText(0,mRightTextWidget->getTextLength());
+    mRightTextWidget->addText(text);
+}
+
+
+void MWGui::JournalWindow::notifyNextPage(MyGUI::WidgetPtr _sender)
+{
+    if(mPageNumber < int(leftPages.size())-1)
+    {
+        mPageNumber = mPageNumber + 1;
+        displayLeftText(leftPages[mPageNumber]);
+        displayRightText(rightPages[mPageNumber]);
+    }
+}
+
+void MWGui::JournalWindow::notifyPrevPage(MyGUI::WidgetPtr _sender)
+{
+    if(mPageNumber > 0)
+    {
+        mPageNumber = mPageNumber - 1;
+        displayLeftText(leftPages[mPageNumber]);
+        displayRightText(rightPages[mPageNumber]);
+    }
+}
diff --git a/apps/openmw/mwgui/journalwindow.hpp b/apps/openmw/mwgui/journalwindow.hpp
new file mode 100644
index 0000000000..e664487634
--- /dev/null
+++ b/apps/openmw/mwgui/journalwindow.hpp
@@ -0,0 +1,57 @@
+#ifndef MWGUI_JOURNAL_H
+#define MWGUI_JOURNAL_H
+
+#include <sstream>
+#include <set>
+#include <string>
+#include <utility>
+
+#include "window_base.hpp"
+
+namespace MWGui
+{
+    class WindowManager;
+
+    class JournalWindow : public WindowBase
+    {
+        public:
+            JournalWindow(WindowManager& parWindowManager);
+            void open();
+
+        private:
+            enum ColorStyle
+            {
+                CS_Sub,
+                CS_Normal,
+                CS_Super
+            };
+
+            void onWindowResize(MyGUI::Window* window);
+
+            void displayLeftText(std::string text);
+            void displayRightText(std::string text);
+
+
+            /**
+            *Called when next/prev button is used.
+            */
+            void notifyNextPage(MyGUI::WidgetPtr _sender);
+            void notifyPrevPage(MyGUI::WidgetPtr _sender);
+
+            static const int lineHeight;
+
+            MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
+            MyGUI::VScrollPtr skillScrollerWidget;
+            int lastPos, clientHeight;
+            MyGUI::EditPtr mLeftTextWidget;
+            MyGUI::EditPtr mRightTextWidget;
+            MyGUI::ButtonPtr mPrevBtn;
+            MyGUI::ButtonPtr mNextBtn;
+            std::vector<std::string> leftPages;
+            std::vector<std::string> rightPages;
+            int mPageNumber; //store the number of the current left page
+    };
+
+}
+
+#endif
\ No newline at end of file
diff --git a/apps/openmw/mwgui/layouts.cpp b/apps/openmw/mwgui/layouts.cpp
index 10740e224a..ebabc6faf1 100644
--- a/apps/openmw/mwgui/layouts.cpp
+++ b/apps/openmw/mwgui/layouts.cpp
@@ -13,7 +13,7 @@
 using namespace MWGui;
 
 
-HUD::HUD(int width, int height, bool fpsSwitch)
+HUD::HUD(int width, int height, int fpsLevel)
     : Layout("openmw_hud_layout.xml")
 {
     setCoord(0,0, width, height);
@@ -37,10 +37,19 @@ HUD::HUD(int width, int height, bool fpsSwitch)
 
     getWidget(crosshair, "Crosshair");
 
-    getWidget(fpsbox, "FPSBox");
-    getWidget(fpscounter, "FPSCounter");
-
-    fpsbox->setVisible(fpsSwitch);
+    if ( fpsLevel == 2 ){
+        getWidget(fpsbox, "FPSBoxAdv");
+        fpsbox->setVisible(true);
+        getWidget(fpscounter, "FPSCounterAdv");
+    }else if ( fpsLevel == 1 ){
+        getWidget(fpsbox, "FPSBox");
+        fpsbox->setVisible(true);
+        getWidget(fpscounter, "FPSCounter");
+    }else{
+        getWidget(fpscounter, "FPSCounter");
+    }
+    getWidget(trianglecounter, "TriangleCounter");
+    getWidget(batchcounter, "BatchCounter");
 
     compass->setImageTexture("textures\\compass.dds");
     crosshair->setImageTexture("textures\\target.dds");
@@ -59,6 +68,15 @@ void HUD::setFPS(float fps)
     fpscounter->setCaption(boost::lexical_cast<std::string>((int)fps));
 }
 
+void HUD::setTriangleCount(size_t count)
+{
+    trianglecounter->setCaption(boost::lexical_cast<std::string>(count));
+}
+
+void HUD::setBatchCount(size_t count)
+{
+    batchcounter->setCaption(boost::lexical_cast<std::string>(count));
+}
 
 void HUD::setStats(int h, int hmax, int m, int mmax, int s, int smax)
 {
diff --git a/apps/openmw/mwgui/layouts.hpp b/apps/openmw/mwgui/layouts.hpp
index ab91f4217a..9917dcdccc 100644
--- a/apps/openmw/mwgui/layouts.hpp
+++ b/apps/openmw/mwgui/layouts.hpp
@@ -32,7 +32,7 @@ namespace MWGui
   class HUD : public OEngine::GUI::Layout
   {
   public:
-    HUD(int width, int height, bool fpsSwitch);
+    HUD(int width, int height, int fpsLevel);
     void setStats(int h, int hmax, int m, int mmax, int s, int smax);
     void setWeapIcon(const char *str);
     void setSpellIcon(const char *str);
@@ -41,6 +41,8 @@ namespace MWGui
     void setEffect(const char *img);
     void setValue (const std::string& id, const MWMechanics::DynamicStat<int>& value);
     void setFPS(float fps);
+    void setTriangleCount(size_t count);
+    void setBatchCount(size_t count);
 
     MyGUI::ProgressPtr health, magicka, stamina;
     MyGUI::StaticImagePtr weapImage, spellImage;
@@ -53,6 +55,8 @@ namespace MWGui
 
     MyGUI::WidgetPtr fpsbox;
     MyGUI::StaticTextPtr fpscounter;
+    MyGUI::StaticTextPtr trianglecounter;
+    MyGUI::StaticTextPtr batchcounter;
   };
 
   class MapWindow : public OEngine::GUI::Layout
diff --git a/apps/openmw/mwgui/mode.hpp b/apps/openmw/mwgui/mode.hpp
index b0dc140297..55f0952ce5 100644
--- a/apps/openmw/mwgui/mode.hpp
+++ b/apps/openmw/mwgui/mode.hpp
@@ -10,6 +10,7 @@ namespace MWGui
       GM_MainMenu,      // Main menu mode
 
       GM_Console,       // Console mode
+      GM_Journal,       // Journal mode
 
       // None of the following are implemented yet
 
diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp
index 095d347e7c..aca9fbd9a8 100644
--- a/apps/openmw/mwgui/window_manager.cpp
+++ b/apps/openmw/mwgui/window_manager.cpp
@@ -1,9 +1,6 @@
 #include "window_manager.hpp"
 #include "layouts.hpp"
 #include "text_input.hpp"
-#include "race.hpp"
-#include "class.hpp"
-#include "birth.hpp"
 #include "review.hpp"
 #include "dialogue.hpp"
 #include "dialogue_history.hpp"
@@ -14,6 +11,8 @@
 #include "../mwinput/inputmanager.hpp"
 
 #include "console.hpp"
+#include "journalwindow.hpp"
+#include "charactercreation.hpp"
 
 #include <assert.h>
 #include <iostream>
@@ -21,29 +20,21 @@
 
 using namespace MWGui;
 
-WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment,
-    const Compiler::Extensions& extensions, bool fpsSwitch, bool newGame)
+WindowManager::WindowManager(MWWorld::Environment& environment,
+    const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre, const std::string logpath)
   : environment(environment)
-  , nameDialog(nullptr)
-  , raceDialog(nullptr)
   , dialogueWindow(nullptr)
-  , classChoiceDialog(nullptr)
-  , generateClassQuestionDialog(nullptr)
-  , generateClassResultDialog(nullptr)
-  , pickClassDialog(nullptr)
-  , createClassDialog(nullptr)
-  , birthSignDialog(nullptr)
-  , reviewDialog(nullptr)
-  , gui(_gui)
   , mode(GM_Game)
   , nextMode(GM_Game)
   , needModeChange(false)
   , shown(GW_ALL)
   , allowed(newGame ? GW_None : GW_ALL)
 {
-    showFPSCounter = fpsSwitch;
+    showFPSLevel = fpsLevel;
 
-    creationStage = NotStarted;
+    // Set up the GUI system
+    mGuiManager = new OEngine::GUI::MyGUIManager(mOgre->getWindow(), mOgre->getScene(), false, logpath);
+    gui = mGuiManager->getGui();
 
     //Register own widgets with MyGUI
     MyGUI::FactoryManager::getInstance().registerFactory<DialogeHistory>("Widget");
@@ -53,19 +44,19 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment
     int w = gui->getViewSize().width;
     int h = gui->getViewSize().height;
 
-    hud = new HUD(w,h, showFPSCounter);
+    hud = new HUD(w,h, showFPSLevel);
     menu = new MainMenu(w,h);
     map = new MapWindow();
     stats = new StatsWindow(*this);
-#if 0
-    inventory = new InventoryWindow ();
-#endif
     console = new Console(w,h, environment, extensions);
+    mJournal = new JournalWindow(*this);
     mMessageBoxManager = new MessageBoxManager(this);
 
     // The HUD is always on
     hud->setVisible(true);
 
+    mCharGen = new CharacterCreation(this, &environment);
+
     // Setup player stats
     for (int i = 0; i < ESM::Attribute::Length; ++i)
     {
@@ -89,26 +80,17 @@ WindowManager::WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment
 
 WindowManager::~WindowManager()
 {
+    delete mGuiManager;
     delete console;
     delete mMessageBoxManager;
     delete hud;
     delete map;
     delete menu;
     delete stats;
-#if 0
-    delete inventory;
-#endif
-
-    delete nameDialog;
-    delete raceDialog;
+    delete mJournal;
     delete dialogueWindow;
-    delete classChoiceDialog;
-    delete generateClassQuestionDialog;
-    delete generateClassResultDialog;
-    delete pickClassDialog;
-    delete createClassDialog;
-    delete birthSignDialog;
-    delete reviewDialog;
+
+    delete mCharGen;
 
     cleanupGarbage();
 }
@@ -135,12 +117,19 @@ void WindowManager::update()
         environment.mInputManager->setGuiMode(nextMode);
         nextMode = GM_Game;
     }
-    if (showFPSCounter)
+    if (showFPSLevel > 0)
     {
         hud->setFPS(mFPS);
+        hud->setTriangleCount(mTriangleCount);
+        hud->setBatchCount(mBatchCount);
     }
 }
 
+MWWorld::Environment& WindowManager::getEnvironment()
+{
+    return environment;
+}
+
 void WindowManager::setNextMode(GuiMode newMode)
 {
     nextMode = newMode;
@@ -158,16 +147,14 @@ void WindowManager::updateVisible()
     map->setVisible(false);
     menu->setVisible(false);
     stats->setVisible(false);
-#if 0
-    inventory->setVisible(false);
-#endif
     console->disable();
+    mJournal->setVisible(false);
 
     // Mouse is visible whenever we're not in game mode
     gui->setVisiblePointer(isGuiMode());
 
     // If in game mode, don't show anything.
-    if(mode == GM_Game)
+    if(mode == GM_Game) //Use a switch/case structure
     {
         return;
     }
@@ -185,126 +172,10 @@ void WindowManager::updateVisible()
         return;
     }
 
-    if (mode == GM_Name)
+    //There must be a more elegant solution
+    if (mode == GM_Name || mode == GM_Race || mode == GM_Class || mode == GM_ClassPick || mode == GM_ClassCreate || mode == GM_Birth || mode == GM_ClassGenerate || mode == GM_Review)
     {
-        if (nameDialog)
-            removeDialog(nameDialog);
-        nameDialog = new TextInputDialog(*this);
-        std::string sName = getGameSettingString("sName", "Name");
-        nameDialog->setTextLabel(sName);
-        nameDialog->setTextInput(playerName);
-        nameDialog->setNextButtonShow(creationStage >= NameChosen);
-        nameDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onNameDialogDone);
-        nameDialog->open();
-        return;
-    }
-
-    if (mode == GM_Race)
-    {
-        if (raceDialog)
-            removeDialog(raceDialog);
-        raceDialog = new RaceDialog(*this);
-        raceDialog->setNextButtonShow(creationStage >= RaceChosen);
-        raceDialog->setRaceId(playerRaceId);
-        raceDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onRaceDialogDone);
-        raceDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onRaceDialogBack);
-        raceDialog->open();
-        return;
-    }
-
-    if (mode == GM_Class)
-    {
-        if (classChoiceDialog)
-            removeDialog(classChoiceDialog);
-        classChoiceDialog = new ClassChoiceDialog(*this);
-        classChoiceDialog->eventButtonSelected = MyGUI::newDelegate(this, &WindowManager::onClassChoice);
-        classChoiceDialog->open();
-        return;
-    }
-
-    if (mode == GM_ClassGenerate)
-    {
-        generateClassStep = 0;
-        generateClass = "";
-        generateClassSpecializations[0] = 0;
-        generateClassSpecializations[1] = 0;
-        generateClassSpecializations[2] = 0;
-        showClassQuestionDialog();
-        return;
-    }
-
-    if (mode == GM_ClassPick)
-    {
-        if (pickClassDialog)
-            removeDialog(pickClassDialog);
-        pickClassDialog = new PickClassDialog(*this);
-        pickClassDialog->setNextButtonShow(creationStage >= ClassChosen);
-        pickClassDialog->setClassId(playerClass.name);
-        pickClassDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onPickClassDialogDone);
-        pickClassDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onPickClassDialogBack);
-        pickClassDialog->open();
-        return;
-    }
-
-    if (mode == GM_ClassCreate)
-    {
-        if (createClassDialog)
-            removeDialog(createClassDialog);
-        createClassDialog = new CreateClassDialog(*this);
-        createClassDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onCreateClassDialogDone);
-        createClassDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onCreateClassDialogBack);
-        createClassDialog->open();
-        return;
-    }
-
-    if (mode == GM_Birth)
-    {
-        if (birthSignDialog)
-            removeDialog(birthSignDialog);
-        birthSignDialog = new BirthDialog(*this);
-        birthSignDialog->setNextButtonShow(creationStage >= BirthSignChosen);
-        birthSignDialog->setBirthId(playerBirthSignId);
-        birthSignDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onBirthSignDialogDone);
-        birthSignDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onBirthSignDialogBack);
-        birthSignDialog->open();
-        return;
-    }
-
-    if (mode == GM_Review)
-    {
-        if (reviewDialog)
-            removeDialog(reviewDialog);
-        reviewDialog = new ReviewDialog(*this);
-        reviewDialog->setPlayerName(playerName);
-        reviewDialog->setRace(playerRaceId);
-        reviewDialog->setClass(playerClass);
-        reviewDialog->setBirthSign(playerBirthSignId);
-
-        reviewDialog->setHealth(playerHealth);
-        reviewDialog->setMagicka(playerMagicka);
-        reviewDialog->setFatigue(playerFatigue);
-
-        {
-            std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> >::iterator end = playerAttributes.end();
-            for (std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> >::iterator it = playerAttributes.begin(); it != end; ++it)
-            {
-                reviewDialog->setAttribute(it->first, it->second);
-            }
-        }
-
-        {
-            std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> >::iterator end = playerSkillValues.end();
-            for (std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> >::iterator it = playerSkillValues.begin(); it != end; ++it)
-            {
-                reviewDialog->setSkillValue(it->first, it->second);
-            }
-            reviewDialog->configureSkills(playerMajorSkills, playerMinorSkills);
-        }
-
-        reviewDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onReviewDialogDone);
-        reviewDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onReviewDialogBack);
-        reviewDialog->eventActivateDialog = MyGUI::newDelegate(this, &WindowManager::onReviewActivateDialog);
-        reviewDialog->open();
+        mCharGen->spawnDialog(mode);
         return;
     }
 
@@ -319,9 +190,6 @@ void WindowManager::updateVisible()
         // Show the windows we want
         map   -> setVisible( (eff & GW_Map) != 0 );
         stats -> setVisible( (eff & GW_Stats) != 0 );
-#if 0
-        //      inventory -> setVisible( eff & GW_Inventory );
-#endif
         return;
     }
 
@@ -344,6 +212,12 @@ void WindowManager::updateVisible()
         return;
     }
 
+    if(mode == GM_Journal)
+    {
+        mJournal->setVisible(true);
+        mJournal->open();
+        return;
+    }
 
     // Unsupported mode, switch back to game
     // Note: The call will eventually end up this method again but
@@ -392,13 +266,34 @@ void WindowManager::setValue (const std::string& id, const MWMechanics::DynamicS
     stats->setValue (id, value);
     hud->setValue (id, value);
     if (id == "HBar")
+    {
         playerHealth = value;
+        mCharGen->setPlayerHealth (value);
+    }
     else if (id == "MBar")
+    {
         playerMagicka = value;
+        mCharGen->setPlayerMagicka (value);
+    }
     else if (id == "FBar")
+    {
         playerFatigue = value;
+        mCharGen->setPlayerFatigue (value);
+    }
 }
 
+#if 0
+MWMechanics::DynamicStat<int> WindowManager::getValue(const std::string& id)
+{
+    if(id == "HBar")
+        return playerHealth;
+    else if (id == "MBar")
+        return playerMagicka;
+    else if (id == "FBar")
+        return playerFatigue;
+}
+#endif
+
 void WindowManager::setValue (const std::string& id, const std::string& value)
 {
     stats->setValue (id, value);
@@ -487,49 +382,6 @@ const std::string &WindowManager::getGameSettingString(const std::string &id, co
     return default_;
 }
 
-void WindowManager::onNameDialogDone(WindowBase* parWindow)
-{
-    if (nameDialog)
-    {
-        playerName = nameDialog->getTextInput();
-        environment.mMechanicsManager->setPlayerName(playerName);
-        removeDialog(nameDialog);
-    }
-
-    // Go to next dialog if name was previously chosen
-    if (creationStage == ReviewNext)
-        setGuiMode(GM_Review);
-    else if (creationStage >= NameChosen)
-        setGuiMode(GM_Race);
-    else
-    {
-        creationStage = NameChosen;
-        setGuiMode(GM_Game);
-    }
-}
-
-void WindowManager::onRaceDialogDone(WindowBase* parWindow)
-{
-    if (raceDialog)
-    {
-        playerRaceId = raceDialog->getRaceId();
-        if (!playerRaceId.empty())
-            environment.mMechanicsManager->setPlayerRace(playerRaceId, raceDialog->getGender() == RaceDialog::GM_Male);
-        removeDialog(raceDialog);
-    }
-
-    // Go to next dialog if race was previously chosen
-    if (creationStage == ReviewNext)
-        setGuiMode(GM_Review);
-    else if(creationStage >= RaceChosen)
-        setGuiMode(GM_Class);
-    else
-    {
-        creationStage = RaceChosen;
-        setGuiMode(GM_Game);
-    }
-}
-
 void WindowManager::onDialogueWindowBye()
 {
     if (dialogueWindow)
@@ -540,434 +392,11 @@ void WindowManager::onDialogueWindowBye()
     setGuiMode(GM_Game);
 }
 
-void WindowManager::onRaceDialogBack()
-{
-    if (raceDialog)
-    {
-        playerRaceId = raceDialog->getRaceId();
-        if (!playerRaceId.empty())
-            environment.mMechanicsManager->setPlayerRace(playerRaceId, raceDialog->getGender() == RaceDialog::GM_Male);
-        removeDialog(raceDialog);
-    }
-
-    setGuiMode(GM_Name);
-}
-
-void WindowManager::onClassChoice(int _index)
-{
-    if (classChoiceDialog)
-    {
-        removeDialog(classChoiceDialog);
-    }
-
-    switch(_index)
-    {
-        case ClassChoiceDialog::Class_Generate:
-            setGuiMode(GM_ClassGenerate);
-            break;
-        case ClassChoiceDialog::Class_Pick:
-            setGuiMode(GM_ClassPick);
-            break;
-        case ClassChoiceDialog::Class_Create:
-            setGuiMode(GM_ClassCreate);
-            break;
-        case ClassChoiceDialog::Class_Back:
-            setGuiMode(GM_Race);
-            break;
-
-    };
-}
-
 void WindowManager::onFrame (float frameDuration)
 {
     mMessageBoxManager->onFrame(frameDuration);
 }
 
-namespace MWGui
-{
-
-    struct Step
-    {
-        const char* text;
-        const char* buttons[3];
-        // The specialization for each answer
-        ESM::Class::Specialization specializations[3];
-    };
-
-    static boost::array<Step, 10> generateClassSteps = { {
-        // Question 1
-        {"On a clear day you chance upon a strange animal, its legs trapped in a hunter's clawsnare. Judging from the bleeding, it will not survive long.",
-         {"Draw your dagger, mercifully endings its life with a single thrust.",
-          "Use herbs from your pack to put it to sleep.",
-          "Do not interfere in the natural evolution of events, but rather take the opportunity to learn more about a strange animal that you have never seen before."},
-         {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
-        },
-        // Question 2
-        {"One Summer afternoon your father gives you a choice of chores.",
-         {"Work in the forge with him casting iron for a new plow.",
-          "Gather herbs for your mother who is preparing dinner.",
-          "Go catch fish at the stream using a net and line."},
-         {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
-        },
-        // Question 3
-        {"Your cousin has given you a very embarrassing nickname and, even worse, likes to call you it in front of your friends. You asked him to stop, but he finds it very amusing to watch you blush.",
-         {"Beat up your cousin, then tell him that if he ever calls you that nickname again, you will bloody him worse than this time.",
-          "Make up a story that makes your nickname a badge of honor instead of something humiliating.",
-          "Make up an even more embarrassing nickname for him and use it constantly until he learns his lesson."},
-         {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
-        },
-        // Question 4
-        {"There is a lot of heated discussion at the local tavern over a grouped of people called 'Telepaths'. They have been hired by certain City-State kings. Rumor has it these Telepaths read a person's mind and tell their lord whether a follower is telling the truth or not.",
-         {"This is a terrible practice. A person's thoughts are his own and no one, not even a king, has the right to make such an invasion into another human's mind.",
-          "Loyal followers to the king have nothing to fear from a Telepath. It is important to have a method of finding assassins and spies before it is too late.",
-          "In these times, it is a necessary evil. Although you do not necessarily like the idea, a Telepath could have certain advantages during a time of war or in finding someone innocent of a crime."},
-         {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
-        },
-        // Question 5
-        {"Your mother sends you to the market with a list of goods to buy. After you finish you find that by mistake a shopkeeper has given you too much money back in exchange for one of the items.",
-         {"Return to the store and give the shopkeeper his hard-earned money, explaining to him the mistake?",
-          "Decide to put the extra money to good use and purchase items that would help your family?",
-          "Pocket the extra money, knowing that shopkeepers in general tend to overcharge customers anyway?"},
-         {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
-        },
-        // Question 6
-        {"While in the market place you witness a thief cut a purse from a noble. Even as he does so, the noble notices and calls for the city guards. In his haste to get away, the thief drops the purse near you. Surprisingly no one seems to notice the bag of coins at your feet.",
-         {"Pick up the bag and signal to the guard, knowing that the only honorable thing to do is return the money to its rightful owner.",
-          "Leave the bag there, knowing that it is better not to get involved.",
-          "Pick up the bag and pocket it, knowing that the extra windfall will help your family in times of trouble."},
-         {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
-        },
-        // Question 7
-        {"Your father sends you on a task which you loathe, cleaning the stables. On the way there, pitchfork in hand, you run into your friend from the homestead near your own. He offers to do it for you, in return for a future favor of his choosing.",
-         {"Decline his offer, knowing that your father expects you to do the work, and it is better not to be in debt.",
-          "Ask him to help you, knowing that two people can do the job faster than one, and agree to help him with one task of his choosing in the future.",
-          "Accept his offer, reasoning that as long as the stables are cleaned, it matters not who does the cleaning."},
-         {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
-        },
-        // Question 8
-        {"Your mother asks you to help fix the stove. While you are working, a very hot pipe slips its mooring and falls towards her.",
-         {"Position yourself between the pipe and your mother.",
-          "Grab the hot pipe and try to push it away.",
-          "Push your mother out of the way."},
-         {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
-        },
-        // Question 9
-        {"While in town the baker gives you a sweetroll. Delighted, you take it into an alley to enjoy only to be intercepted by a gang of three other kids your age. The leader demands the sweetroll, or else he and his friends will beat you and take it.",
-         {"Drop the sweetroll and step on it, then get ready for the fight.",
-          "Give him the sweetroll now without argument, knowing that later this afternoon you will have all your friends with you and can come and take whatever he owes you.",
-          "Act like you're going to give him the sweetroll, but at the last minute throw it in the air, hoping that they'll pay attention to it long enough for you to get a shot in on the leader."},
-         {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
-        },
-        // Question 10
-        {"Entering town you find that you are witness to a very well-dressed man running from a crowd. He screams to you for help. The crowd behind him seem very angry.",
-         {"Rush to the town's aid immediately, despite your lack of knowledge of the circumstances.",
-          "Stand aside and allow the man and the mob to pass, realizing it is probably best not to get involved.",
-          "Rush to the man's aid immediately, despite your lack of knowledge of the circumstances."},
-         {ESM::Class::Combat, ESM::Class::Magic, ESM::Class::Stealth}
-        }
-    } };
-}
-
-void WindowManager::showClassQuestionDialog()
-{
-    if (generateClassStep == generateClassSteps.size())
-    {
-
-        static boost::array<ClassPoint, 23> classes = { {
-            {"Acrobat",     {6, 2, 2}},
-            {"Agent",       {6, 1, 3}},
-            {"Archer",      {3, 5, 2}},
-            {"Archer",      {5, 5, 0}},
-            {"Assassin",    {6, 3, 1}},
-            {"Barbarian",   {3, 6, 1}},
-            {"Bard",        {3, 3, 3}},
-            {"Battlemage",  {1, 3, 6}},
-            {"Crusader",    {1, 6, 3}},
-            {"Healer",      {3, 1, 6}},
-            {"Knight",      {2, 6, 2}},
-            {"Monk",        {5, 3, 2}},
-            {"Nightblade",  {4, 2, 4}},
-            {"Pilgrim",     {5, 2, 3}},
-            {"Rogue",       {3, 4, 3}},
-            {"Rogue",       {4, 4, 2}},
-            {"Rogue",       {5, 4, 1}},
-            {"Scout",       {2, 5, 3}},
-            {"Sorcerer",    {2, 2, 6}},
-            {"Spellsword",  {2, 4, 4}},
-            {"Spellsword",  {5, 1, 4}},
-            {"Witchhunter", {2, 3, 5}},
-            {"Witchhunter", {5, 0, 5}}
-        } };
-
-        int match = -1;
-        for (unsigned i = 0; i < classes.size(); ++i)
-        {
-            if (generateClassSpecializations[0] == classes[i].points[0] &&
-                generateClassSpecializations[1] == classes[i].points[1] &&
-                generateClassSpecializations[2] == classes[i].points[2])
-            {
-                match = i;
-                generateClass = classes[i].id;
-                break;
-            }
-        }
-
-        if (match == -1)
-        {
-            if (generateClassSpecializations[0] >= 7)
-                generateClass = "Thief";
-            else if (generateClassSpecializations[1] >= 7)
-                generateClass = "Warrior";
-            else if (generateClassSpecializations[2] >= 7)
-                generateClass = "Mage";
-            else
-            {
-                std::cerr
-                    << "Failed to deduce class from chosen answers in generate class dialog"
-                    << std::endl;
-                generateClass = "Thief";
-            }
-        }
-
-        if (generateClassResultDialog)
-            removeDialog(generateClassResultDialog);
-        generateClassResultDialog = new GenerateClassResultDialog(*this);
-        generateClassResultDialog->setClassId(generateClass);
-        generateClassResultDialog->eventBack = MyGUI::newDelegate(this, &WindowManager::onGenerateClassBack);
-        generateClassResultDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onGenerateClassDone);
-        generateClassResultDialog->open();
-        return;
-    }
-
-    if (generateClassStep > generateClassSteps.size())
-    {
-        setGuiMode(GM_Class);
-        return;
-    }
-
-    if (generateClassQuestionDialog)
-        removeDialog(generateClassQuestionDialog);
-    generateClassQuestionDialog = new InfoBoxDialog(*this);
-
-    InfoBoxDialog::ButtonList buttons;
-    generateClassQuestionDialog->setText(generateClassSteps[generateClassStep].text);
-    buttons.push_back(generateClassSteps[generateClassStep].buttons[0]);
-    buttons.push_back(generateClassSteps[generateClassStep].buttons[1]);
-    buttons.push_back(generateClassSteps[generateClassStep].buttons[2]);
-    generateClassQuestionDialog->setButtons(buttons);
-    generateClassQuestionDialog->eventButtonSelected = MyGUI::newDelegate(this, &WindowManager::onClassQuestionChosen);
-    generateClassQuestionDialog->open();
-}
-
-void WindowManager::onClassQuestionChosen(int _index)
-{
-    if (generateClassQuestionDialog)
-        removeDialog(generateClassQuestionDialog);
-    if (_index < 0 || _index >= 3)
-    {
-        setGuiMode(GM_Class);
-        return;
-    }
-
-    ESM::Class::Specialization specialization = generateClassSteps[generateClassStep].specializations[_index];
-    if (specialization == ESM::Class::Stealth)
-        ++generateClassSpecializations[0];
-    else if (specialization == ESM::Class::Combat)
-        ++generateClassSpecializations[1];
-    else if (specialization == ESM::Class::Magic)
-        ++generateClassSpecializations[2];
-    ++generateClassStep;
-    showClassQuestionDialog();
-}
-
-void WindowManager::onGenerateClassBack()
-{
-    if(creationStage < ClassChosen)
-        creationStage = ClassChosen;
-
-    if (generateClassResultDialog)
-        removeDialog(generateClassResultDialog);
-    environment.mMechanicsManager->setPlayerClass(generateClass);
-
-    setGuiMode(GM_Class);
-}
-
-void WindowManager::onGenerateClassDone(WindowBase* parWindow)
-{
-    if (generateClassResultDialog)
-        removeDialog(generateClassResultDialog);
-    environment.mMechanicsManager->setPlayerClass(generateClass);
-
-     // Go to next dialog if class was previously chosen
-    if (creationStage == ReviewNext)
-        setGuiMode(GM_Review);
-    else if (creationStage >= ClassChosen)
-        setGuiMode(GM_Birth);
-    else
-    {
-        creationStage = ClassChosen;
-        setGuiMode(GM_Game);
-    }
-}
-
-
-void WindowManager::onPickClassDialogDone(WindowBase* parWindow)
-{
-    if (pickClassDialog)
-    {
-        const std::string &classId = pickClassDialog->getClassId();
-        if (!classId.empty())
-            environment.mMechanicsManager->setPlayerClass(classId);
-        const ESM::Class *klass = environment.mWorld->getStore().classes.find(classId);
-        if (klass)
-            playerClass = *klass;
-        removeDialog(pickClassDialog);
-    }
-
-    // Go to next dialog if class was previously chosen
-    if (creationStage == ReviewNext)
-        setGuiMode(GM_Review);
-    else if (creationStage >= ClassChosen)
-        setGuiMode(GM_Birth);
-    else
-    {
-        creationStage = ClassChosen;
-        setGuiMode(GM_Game);
-    }
-}
-
-void WindowManager::onPickClassDialogBack()
-{
-    if (pickClassDialog)
-    {
-        const std::string classId = pickClassDialog->getClassId();
-        if (!classId.empty())
-            environment.mMechanicsManager->setPlayerClass(classId);
-        removeDialog(pickClassDialog);
-    }
-
-    setGuiMode(GM_Class);
-}
-
-void WindowManager::onCreateClassDialogDone(WindowBase* parWindow)
-{
-    if (createClassDialog)
-    {
-        ESM::Class klass;
-        klass.name = createClassDialog->getName();
-        klass.description = createClassDialog->getDescription();
-        klass.data.specialization = createClassDialog->getSpecializationId();
-        klass.data.isPlayable = 0x1;
-
-        std::vector<int> attributes = createClassDialog->getFavoriteAttributes();
-        assert(attributes.size() == 2);
-        klass.data.attribute[0] = attributes[0];
-        klass.data.attribute[1] = attributes[1];
-
-        std::vector<ESM::Skill::SkillEnum> majorSkills = createClassDialog->getMajorSkills();
-        std::vector<ESM::Skill::SkillEnum> minorSkills = createClassDialog->getMinorSkills();
-        assert(majorSkills.size() >= sizeof(klass.data.skills)/sizeof(klass.data.skills[0]));
-        assert(minorSkills.size() >= sizeof(klass.data.skills)/sizeof(klass.data.skills[0]));
-        for (size_t i = 0; i < sizeof(klass.data.skills)/sizeof(klass.data.skills[0]); ++i)
-        {
-            klass.data.skills[i][1] = majorSkills[i];
-            klass.data.skills[i][0] = minorSkills[i];
-        }
-        environment.mMechanicsManager->setPlayerClass(klass);
-        playerClass = klass;
-
-        removeDialog(createClassDialog);
-    }
-
-    // Go to next dialog if class was previously chosen
-    if (creationStage == ReviewNext)
-        setGuiMode(GM_Review);
-    else if (creationStage >= ClassChosen)
-        setGuiMode(GM_Birth);
-    else
-    {
-        creationStage = ClassChosen;
-        setGuiMode(GM_Game);
-    }
-}
-
-void WindowManager::onCreateClassDialogBack()
-{
-    if (createClassDialog)
-        removeDialog(createClassDialog);
-
-    setGuiMode(GM_Class);
-}
-
-void WindowManager::onBirthSignDialogDone(WindowBase* parWindow)
-{
-    if (birthSignDialog)
-    {
-        playerBirthSignId = birthSignDialog->getBirthId();
-        if (!playerBirthSignId.empty())
-            environment.mMechanicsManager->setPlayerBirthsign(playerBirthSignId);
-        removeDialog(birthSignDialog);
-    }
-
-    // Go to next dialog if birth sign was previously chosen
-    if (creationStage >= BirthSignChosen)
-        setGuiMode(GM_Review);
-    else
-    {
-        creationStage = BirthSignChosen;
-        setGuiMode(GM_Game);
-    }
-}
-
-void WindowManager::onBirthSignDialogBack()
-{
-    if (birthSignDialog)
-    {
-        environment.mMechanicsManager->setPlayerBirthsign(birthSignDialog->getBirthId());
-        removeDialog(birthSignDialog);
-    }
-
-    setGuiMode(GM_Class);
-}
-
-void WindowManager::onReviewDialogDone(WindowBase* parWindow)
-{
-    if (reviewDialog)
-        removeDialog(reviewDialog);
-
-    setGuiMode(GM_Game);
-}
-
-void WindowManager::onReviewDialogBack()
-{
-    if (reviewDialog)
-        removeDialog(reviewDialog);
-
-    setGuiMode(GM_Birth);
-}
-
-void WindowManager::onReviewActivateDialog(int parDialog)
-{
-    if (reviewDialog)
-        removeDialog(reviewDialog);
-    creationStage = ReviewNext;
-
-    switch(parDialog)
-    {
-        case ReviewDialog::NAME_DIALOG:
-            setGuiMode(GM_Name);
-            break;
-        case ReviewDialog::RACE_DIALOG:
-            setGuiMode(GM_Race);
-            break;
-        case ReviewDialog::CLASS_DIALOG:
-            setGuiMode(GM_Class);
-            break;
-        case ReviewDialog::BIRTHSIGN_DIALOG:
-            setGuiMode(GM_Birth);
-    };
-}
-
 const ESMS::ESMStore& WindowManager::getStore() const
 {
     return environment.mWorld->getStore();
diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp
index 293bac6013..89ff4b9bb9 100644
--- a/apps/openmw/mwgui/window_manager.hpp
+++ b/apps/openmw/mwgui/window_manager.hpp
@@ -8,13 +8,15 @@
 
    MyGUI should be initialized separately before creating instances of
    this class.
- */
+**/
 
 #include <string>
 #include <vector>
 #include <set>
 
 #include <components/esm_store/store.hpp>
+#include <openengine/ogre/renderer.hpp>
+#include <openengine/gui/manager.hpp>
 #include "../mwmechanics/stat.hpp"
 #include "mode.hpp"
 
@@ -32,6 +34,12 @@ namespace Compiler
 namespace MWWorld
 {
     class Environment;
+    class World;
+}
+
+namespace MWMechanics
+{
+    class MechanicsManager;
 }
 
 namespace OEngine
@@ -51,17 +59,12 @@ namespace MWGui
   class StatsWindow;
   class InventoryWindow;
   class Console;
+  class JournalWindow;
+  class CharacterCreation;
 
   class TextInputDialog;
   class InfoBoxDialog;
-  class RaceDialog;
   class DialogueWindow;
-  class ClassChoiceDialog;
-  class GenerateClassResultDialog;
-  class PickClassDialog;
-  class CreateClassDialog;
-  class BirthDialog;
-  class ReviewDialog;
   class MessageBoxManager;
 
   struct ClassPoint
@@ -79,92 +82,11 @@ namespace MWGui
     typedef std::vector<Faction> FactionList;
     typedef std::vector<int> SkillList;
 
-  private:
-    MWWorld::Environment& environment;
-    HUD *hud;
-    MapWindow *map;
-    MainMenu *menu;
-    StatsWindow *stats;
-    MessageBoxManager *mMessageBoxManager;
-#if 0
-    InventoryWindow *inventory;
-#endif
-    Console *console;
-
-    // Character creation
-    TextInputDialog *nameDialog;
-    RaceDialog *raceDialog;
-    DialogueWindow *dialogueWindow;
-    ClassChoiceDialog *classChoiceDialog;
-    InfoBoxDialog *generateClassQuestionDialog;
-    GenerateClassResultDialog *generateClassResultDialog;
-    PickClassDialog *pickClassDialog;
-    CreateClassDialog *createClassDialog;
-    BirthDialog *birthSignDialog;
-    ReviewDialog *reviewDialog;
-
-    // Keeps track of current step in Generate Class dialogs
-    unsigned generateClassStep;
-    // A counter for each specialization which is increased when an answer is chosen, in order: Stealth, Combat, Magic
-    unsigned generateClassSpecializations[3];
-    std::string generateClass;
-
-    // Various stats about player as needed by window manager
-    std::string playerName;
-    ESM::Class playerClass;
-    std::string playerRaceId, playerBirthSignId;
-    std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > playerAttributes;
-    SkillList playerMajorSkills, playerMinorSkills;
-    std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> > playerSkillValues;
-    MWMechanics::DynamicStat<int> playerHealth, playerMagicka, playerFatigue;
-
-    // Gui
-    MyGUI::Gui *gui;
-
-    // Current gui mode
-    GuiMode mode;
-
-    /**
-     * Next mode to activate in update().
-     */
-    GuiMode nextMode;
-    /**
-     * Whether a mode change is needed in update().
-     * Will use @a nextMode as the new mode.
-     */
-    bool needModeChange;
-
-    std::vector<OEngine::GUI::Layout*> garbageDialogs;
-    void cleanupGarbage();
-
-    // Currently shown windows in inventory mode
-    GuiWindow shown;
-
-    /* Currently ALLOWED windows in inventory mode. This is used at
-       the start of the game, when windows are enabled one by one
-       through script commands. You can manipulate this through using
-       allow() and disableAll().
-
-       The setting should also affect visibility of certain HUD
-       elements, but this is not done yet.
-     */
-    GuiWindow allowed;
-
-    // Update visibility of all windows based on mode, shown and
-    // allowed settings.
-    void updateVisible();
+    WindowManager(MWWorld::Environment& environment, const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *mOgre, const std::string logpath);
+    virtual ~WindowManager();
 
     void setGuiMode(GuiMode newMode);
 
-    bool showFPSCounter;
-    float mFPS;
-
-  public:
-    /// The constructor needs the main Gui object
-    WindowManager(MyGUI::Gui *_gui, MWWorld::Environment& environment,
-        const Compiler::Extensions& extensions, bool fpsSwitch, bool newGame);
-    virtual ~WindowManager();
-
     /**
      * Should be called each frame to update windows/gui elements.
      * This could mean updating sizes of gui elements or opening
@@ -172,6 +94,8 @@ namespace MWGui
      */
     void update();
 
+    MWWorld::Environment& getEnvironment();
+
     void setMode(GuiMode newMode)
     {
       if (newMode==GM_Inventory && allowed==GW_None)
@@ -184,8 +108,7 @@ namespace MWGui
 
     GuiMode getMode() const { return mode; }
 
-    // Everything that is not game mode is considered "gui mode"
-    bool isGuiMode() const { return getMode() != GM_Game; }
+    bool isGuiMode() const { return getMode() != GM_Game; } // Everything that is not game mode is considered "gui mode"
 
     // Disallow all inventory mode windows
     void disallowAll()
@@ -203,56 +126,38 @@ namespace MWGui
 
     MyGUI::Gui* getGui() const { return gui; }
 
-    void wmSetFPS(float fps) { mFPS = fps; }
+    void wmUpdateFps(float fps, size_t triangleCount, size_t batchCount)
+    {
+        mFPS = fps;
+        mTriangleCount = triangleCount;
+        mBatchCount = batchCount;
+    }
 
+//    MWMechanics::DynamicStat<int> getValue(const std::string& id);
+
+    ///< Set value for the given ID.
     void setValue (const std::string& id, const MWMechanics::Stat<int>& value);
-    ///< Set value for the given ID.
-
     void setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat<float>& value);
-    ///< Set value for the given ID.
-
     void setValue (const std::string& id, const MWMechanics::DynamicStat<int>& value);
-    ///< Set value for the given ID.
-
     void setValue (const std::string& id, const std::string& value);
-    ///< set value for the given ID.
-
     void setValue (const std::string& id, int value);
-    ///< set value for the given ID.
 
-    void setPlayerClass (const ESM::Class &class_);
-    ///< set current class of player
+    void setPlayerClass (const ESM::Class &class_);                        ///< set current class of player
+    void configureSkills (const SkillList& major, const SkillList& minor); ///< configure skill groups, each set contains the skill ID for that group.
+    void setFactions (const FactionList& factions);                        ///< set faction and rank to display on stat window, use an empty vector to disable
+    void setBirthSign (const std::string &signId);                         ///< set birth sign to display on stat window, use an empty string to disable.
+    void setReputation (int reputation);                                   ///< set the current reputation value
+    void setBounty (int bounty);                                           ///< set the current bounty value
+    void updateSkillArea();                                                ///< update display of skills, factions, birth sign, reputation and bounty
 
-    void configureSkills (const SkillList& major, const SkillList& minor);
-    ///< configure skill groups, each set contains the skill ID for that group.
-
-    void setFactions (const FactionList& factions);
-    ///< set faction and rank to display on stat window, use an empty vector to disable
-
-    void setBirthSign (const std::string &signId);
-    ///< set birth sign to display on stat window, use an empty string to disable.
-
-    void setReputation (int reputation);
-    ///< set the current reputation value
-
-    void setBounty (int bounty);
-    ///< set the current bounty value
-
-    void updateSkillArea();
-    ///< update display of skills, factions, birth sign, reputation and bounty
 
     template<typename T>
-    void removeDialog(T*& dialog);
-    ///< Casts to OEngine::GUI::Layout and calls removeDialog, then resets pointer to nullptr.
+    void removeDialog(T*& dialog); ///< Casts to OEngine::GUI::Layout and calls removeDialog, then resets pointer to nullptr.
+    void removeDialog(OEngine::GUI::Layout* dialog); ///< Hides dialog and schedules dialog to be deleted.
 
-    void removeDialog(OEngine::GUI::Layout* dialog);
-    ///< Hides dialog and schedules dialog to be deleted.
-    
     void messageBox (const std::string& message, const std::vector<std::string>& buttons);
-    
-    int readPressedButton ();
-    ///< returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->InteractiveMessageBox)
-    
+    int readPressedButton (); ///< returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->InteractiveMessageBox)
+
     void onFrame (float frameDuration);
 
     /**
@@ -267,54 +172,58 @@ namespace MWGui
     const ESMS::ESMStore& getStore() const;
 
   private:
+    OEngine::GUI::MyGUIManager *mGuiManager;
+    MWWorld::Environment& environment;
+    HUD *hud;
+    MapWindow *map;
+    MainMenu *menu;
+    StatsWindow *stats;
+    MessageBoxManager *mMessageBoxManager;
+    Console *console;
+    JournalWindow* mJournal;
+    DialogueWindow *dialogueWindow;
+
+    CharacterCreation* mCharGen;
+
+    // Various stats about player as needed by window manager
+    ESM::Class playerClass;
+    std::string playerName;
+    std::string playerRaceId;
+    std::string playerBirthSignId;
+    std::map<ESM::Attribute::AttributeID, MWMechanics::Stat<int> > playerAttributes;
+    SkillList playerMajorSkills, playerMinorSkills;
+    std::map<ESM::Skill::SkillEnum, MWMechanics::Stat<float> > playerSkillValues;
+    MWMechanics::DynamicStat<int> playerHealth, playerMagicka, playerFatigue;
+
+
+    MyGUI::Gui *gui; // Gui
+    GuiMode mode; // Current gui mode
+    GuiMode nextMode; // Next mode to activate in update()
+    bool needModeChange; //Whether a mode change is needed in update() [will use nextMode]
+
+    std::vector<OEngine::GUI::Layout*> garbageDialogs;
+    void cleanupGarbage();
+
+    GuiWindow shown; // Currently shown windows in inventory mode
+
+    /* Currently ALLOWED windows in inventory mode. This is used at
+       the start of the game, when windows are enabled one by one
+       through script commands. You can manipulate this through using
+       allow() and disableAll().
+
+       The setting should also affect visibility of certain HUD
+       elements, but this is not done yet.
+     */
+    GuiWindow allowed;
+
+    void updateVisible(); // Update visibility of all windows based on mode, shown and allowed settings
+
+    int showFPSLevel;
+    float mFPS;
+    size_t mTriangleCount;
+    size_t mBatchCount;
 
     void onDialogueWindowBye();
-
-    // Character generation: Name dialog
-    void onNameDialogDone(WindowBase* parWindow);
-
-    // Character generation: Race dialog
-    void onRaceDialogDone(WindowBase* parWindow);
-    void onRaceDialogBack();
-
-    // Character generation: Choose class process
-    void onClassChoice(int _index);
-
-    // Character generation: Generate Class
-    void showClassQuestionDialog();
-    void onClassQuestionChosen(int _index);
-    void onGenerateClassBack();
-    void onGenerateClassDone(WindowBase* parWindow);
-
-    // Character generation: Pick Class dialog
-    void onPickClassDialogDone(WindowBase* parWindow);
-    void onPickClassDialogBack();
-
-    // Character generation: Create Class dialog
-    void onCreateClassDialogDone(WindowBase* parWindow);
-    void onCreateClassDialogBack();
-
-    // Character generation: Birth sign dialog
-    void onBirthSignDialogDone(WindowBase* parWindow);
-    void onBirthSignDialogBack();
-
-    // Character generation: Review dialog
-    void onReviewDialogDone(WindowBase* parWindow);
-    void onReviewDialogBack();
-    void onReviewActivateDialog(int parDialog);
-
-    enum CreationStageEnum
-    {
-        NotStarted,
-        NameChosen,
-        RaceChosen,
-        ClassChosen,
-        BirthSignChosen,
-        ReviewNext
-    };
-
-    // Which state the character creating is in, controls back/next/ok buttons
-    CreationStageEnum creationStage;
   };
 
   template<typename T>
diff --git a/apps/openmw/mwinput/inputmanager.cpp b/apps/openmw/mwinput/inputmanager.cpp
index eb6c59963b..88534dddae 100644
--- a/apps/openmw/mwinput/inputmanager.cpp
+++ b/apps/openmw/mwinput/inputmanager.cpp
@@ -83,27 +83,14 @@ namespace MWInput
     MWGui::WindowManager &windows;
     OMW::Engine& mEngine;
 
-    // Count screenshots.
-    int shotCount;
-
 
    /* InputImpl Methods */
 
-    // Write screenshot to file.
     void screenshot()
     {
-
-      // Find the first unused filename with a do-while
-      char buf[50];
-      do
-      {
-        snprintf(buf, 50, "screenshot%03d.png", shotCount++);
-      } while (boost::filesystem::exists(buf));
-
-      ogre.screenshot(buf);
+        mEngine.screenshot();
     }
 
-
     /* toggleInventory() is called when the user presses the button to toggle the inventory screen. */
     void toggleInventory()
     {
@@ -134,6 +121,21 @@ namespace MWInput
       else setGuiMode(GM_Console);
     }
 
+    void toggleJournal()
+    {
+      using namespace MWGui;
+
+      GuiMode mode = windows.getMode();
+
+      // Toggle between game mode and journal mode
+      if(mode == GM_Game)
+        setGuiMode(GM_Journal);
+      else if(mode == GM_Journal)
+        setGuiMode(GM_Game);
+
+      // .. but don't touch any other mode.
+    }
+
     void activate()
     {
         mEngine.activate();
@@ -168,8 +170,7 @@ namespace MWInput
         poller(input),
         player(_player),
         windows(_windows),
-        mEngine (engine),
-        shotCount(0)
+        mEngine (engine)
     {
       using namespace OEngine::Input;
       using namespace OEngine::Render;
@@ -188,6 +189,8 @@ namespace MWInput
                        "Toggle inventory screen");
       disp->funcs.bind(A_Console, boost::bind(&InputImpl::toggleConsole, this),
                        "Toggle console");
+      disp->funcs.bind(A_Journal, boost::bind(&InputImpl::toggleJournal, this),
+                       "Toggle journal");
       disp->funcs.bind(A_Activate, boost::bind(&InputImpl::activate, this),
                        "Activate");
       disp->funcs.bind(A_AutoMove, boost::bind(&InputImpl::toggleAutoMove, this),
@@ -236,6 +239,7 @@ namespace MWInput
       disp->bind(A_Screenshot, KC_SYSRQ);
       disp->bind(A_Inventory, KC_I);
       disp->bind(A_Console, KC_F1);
+      disp->bind(A_Journal, KC_J);
       disp->bind(A_Activate, KC_SPACE);
       disp->bind(A_AutoMove, KC_Z);
       disp->bind(A_ToggleSneak, KC_X);
diff --git a/apps/openmw/mwmechanics/mechanicsmanager.cpp b/apps/openmw/mwmechanics/mechanicsmanager.cpp
index 33093c24dd..7ed81f7850 100644
--- a/apps/openmw/mwmechanics/mechanicsmanager.cpp
+++ b/apps/openmw/mwmechanics/mechanicsmanager.cpp
@@ -250,6 +250,7 @@ namespace MWMechanics
         while (iter!=mActors.end())
             if (iter->getCell()==cellStore)
             {
+                //std::cout << "Erasing an actor";
                 mActors.erase (iter++);
             }
             else
diff --git a/apps/openmw/mwrender/actors.cpp b/apps/openmw/mwrender/actors.cpp
new file mode 100644
index 0000000000..acc6554049
--- /dev/null
+++ b/apps/openmw/mwrender/actors.cpp
@@ -0,0 +1,125 @@
+#include "actors.hpp"
+#include <OgreSceneNode.h>
+
+
+
+
+using namespace Ogre;
+using namespace MWRender;
+using namespace NifOgre;
+
+void Actors::setMwRoot(Ogre::SceneNode* root){
+    mMwRoot = root;
+}
+void Actors::insertNPC(const MWWorld::Ptr& ptr){
+
+        insertBegin(ptr, true, true);
+         NpcAnimation* anim = new MWRender::NpcAnimation(ptr, mEnvironment, mRend);
+
+        mAllActors[ptr] = anim;
+}
+void Actors::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_){
+    Ogre::SceneNode* cellnode;
+    if(mCellSceneNodes.find(ptr.getCell()) == mCellSceneNodes.end())
+    {
+        //Create the scenenode and put it in the map
+        cellnode = mMwRoot->createChildSceneNode();
+        mCellSceneNodes[ptr.getCell()] = cellnode;
+    }
+    else
+    {
+        cellnode = mCellSceneNodes[ptr.getCell()];
+    }
+
+    Ogre::SceneNode* insert = cellnode->createChildSceneNode();
+    const float *f = ptr.getRefData().getPosition().pos;
+    insert->setPosition(f[0], f[1], f[2]);
+    insert->setScale(ptr.getCellRef().scale, ptr.getCellRef().scale, ptr.getCellRef().scale);
+
+    // Convert MW rotation to a quaternion:
+    f = ptr.getCellRef().pos.rot;
+
+    // Rotate around X axis
+    Quaternion xr(Radian(-f[0]), Vector3::UNIT_X);
+
+    // Rotate around Y axis
+    Quaternion yr(Radian(-f[1]), Vector3::UNIT_Y);
+
+    // Rotate around Z axis
+    Quaternion zr(Radian(-f[2]), Vector3::UNIT_Z);
+
+   // Rotates first around z, then y, then x
+    insert->setOrientation(xr*yr*zr);
+    if (!enabled)
+         insert->setVisible (false);
+    ptr.getRefData().setBaseNode(insert);
+
+
+}
+void Actors::insertCreature (const MWWorld::Ptr& ptr){
+
+    insertBegin(ptr, true, true);
+   CreatureAnimation* anim = new MWRender::CreatureAnimation(ptr, mEnvironment, mRend);
+    //mAllActors.insert(std::pair<MWWorld::Ptr, Animation*>(ptr,anim));
+    mAllActors[ptr] = anim;
+   //mAllActors.push_back(&anim);*/
+}
+
+bool Actors::deleteObject (const MWWorld::Ptr& ptr)
+{
+	delete mAllActors[ptr];
+	mAllActors.erase(ptr);
+    if (Ogre::SceneNode *base = ptr.getRefData().getBaseNode())
+    {
+
+        Ogre::SceneNode *parent = base->getParentSceneNode();
+
+        for (std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *>::const_iterator iter (
+            mCellSceneNodes.begin()); iter!=mCellSceneNodes.end(); ++iter)
+            if (iter->second==parent)
+            {
+                base->removeAndDestroyAllChildren();
+                mRend.getScene()->destroySceneNode (base);
+                ptr.getRefData().setBaseNode (0);
+                return true;
+            }
+
+        return false;
+    }
+
+    return true;
+}
+
+void Actors::removeCell(MWWorld::Ptr::CellStore* store){
+    if(mCellSceneNodes.find(store) != mCellSceneNodes.end())
+    {
+        Ogre::SceneNode* base = mCellSceneNodes[store];
+        base->removeAndDestroyAllChildren();
+        mCellSceneNodes.erase(store);
+        mRend.getScene()->destroySceneNode(base);
+        base = 0;
+    }
+	for(std::map<MWWorld::Ptr, Animation*>::iterator iter = mAllActors.begin(); iter != mAllActors.end(); iter++)
+	{
+		if(iter->first.getCell() == store){
+			delete iter->second;
+			mAllActors.erase(iter);
+		}
+	}
+
+}
+
+void Actors::playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number){
+    if(mAllActors.find(ptr) != mAllActors.end())
+        mAllActors[ptr]->startScript(groupName, mode, number);
+}
+void Actors::skipAnimation (const MWWorld::Ptr& ptr){
+    if(mAllActors.find(ptr) != mAllActors.end())
+        mAllActors[ptr]->stopScript();
+}
+void Actors::update (float duration){
+    for(std::map<MWWorld::Ptr, Animation*>::iterator iter = mAllActors.begin(); iter != mAllActors.end(); iter++)
+	{
+		(iter->second)->runAnimation(duration);
+	}
+}
diff --git a/apps/openmw/mwrender/actors.hpp b/apps/openmw/mwrender/actors.hpp
new file mode 100644
index 0000000000..7179c08fb4
--- /dev/null
+++ b/apps/openmw/mwrender/actors.hpp
@@ -0,0 +1,59 @@
+#ifndef _GAME_RENDER_ACTORS_H
+#define _GAME_RENDER_ACTORS_H
+
+#include "components/esm_store/cell_store.hpp"
+#include <map>
+#include <list>
+
+
+
+#include <openengine/ogre/renderer.hpp>
+#include "components/nifogre/ogre_nif_loader.hpp"
+
+#include "../mwworld/refdata.hpp"
+#include "../mwworld/ptr.hpp"
+#include "../mwworld/actiontalk.hpp"
+#include "../mwworld/environment.hpp"
+#include "npcanimation.hpp"
+#include "creatureanimation.hpp"
+#include <openengine/bullet/physic.hpp>
+
+namespace MWRender{
+    class Actors{
+        OEngine::Render::OgreRenderer &mRend;
+        std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
+        Ogre::SceneNode* mMwRoot;
+        MWWorld::Environment& mEnvironment;
+		std::map<MWWorld::Ptr, Animation*> mAllActors;
+
+
+
+        public:
+        Actors(OEngine::Render::OgreRenderer& _rend, MWWorld::Environment& _env): mRend(_rend), mEnvironment(_env){}
+        ~Actors(){}
+        void setMwRoot(Ogre::SceneNode* root);
+        void insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_);
+        void insertCreature (const MWWorld::Ptr& ptr);
+        void insertNPC(const MWWorld::Ptr& ptr);
+         bool deleteObject (const MWWorld::Ptr& ptr);
+        ///< \return found?
+
+        void removeCell(MWWorld::Ptr::CellStore* store);
+
+        void playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode,
+        int number = 1);
+        ///< Run animation for a MW-reference. Calls to this function for references that are currently not
+        /// in the rendered scene should be ignored.
+        ///
+        /// \param mode: 0 normal, 1 immediate start, 2 immediate loop
+        /// \param number How offen the animation should be run
+
+        void skipAnimation (const MWWorld::Ptr& ptr);
+        ///< Skip the animation for the given MW-reference for one frame. Calls to this function for
+        /// references that are currently not in the rendered scene should be ignored.
+
+        void update (float duration);
+
+    };
+}
+#endif
diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp
new file mode 100644
index 0000000000..63855f3b81
--- /dev/null
+++ b/apps/openmw/mwrender/animation.cpp
@@ -0,0 +1,477 @@
+#include "animation.hpp"
+
+
+namespace MWRender{
+    std::map<std::string, int> Animation::mUniqueIDs;
+
+    Animation::~Animation(){
+    }
+
+    std::string Animation::getUniqueID(std::string mesh){
+    int counter;
+    std::string copy = mesh;
+    std::transform(copy.begin(), copy.end(), copy.begin(), ::tolower);
+    if(mUniqueIDs.find(copy) == mUniqueIDs.end()){
+        counter = mUniqueIDs[copy] = 0;
+    }
+    else{
+        mUniqueIDs[copy] = mUniqueIDs[copy] + 1;
+        counter = mUniqueIDs[copy];
+    }
+
+    std::stringstream out;
+			if(counter > 99 && counter < 1000)
+				out << "0";
+			else if(counter > 9)
+				out << "00";
+			else
+				out << "000";
+            out << counter;
+    return out.str();
+}
+	void Animation::startScript(std::string groupname, int mode, int loops){
+		//If groupname is recognized set animate to true
+		//Set the start time and stop time
+		//How many times to loop
+        if(groupname == "all"){
+            animate = loops;
+            time = startTime;
+        }
+        else if(textmappings){
+
+            std::string startName = groupname + ": loop start";
+            std::string stopName = groupname + ": loop stop";
+
+            bool first = false;
+
+            if(loops > 1){
+                startName = groupname + ": loop start";
+                stopName = groupname + ": loop stop";
+
+                for(std::map<std::string, float>::iterator iter = textmappings->begin(); iter != textmappings->end(); iter++){
+
+                std::string current = iter->first.substr(0, startName.size());
+                std::transform(current.begin(), current.end(), current.begin(), ::tolower);
+                std::string current2 = iter->first.substr(0, stopName.size());
+                std::transform(current2.begin(), current2.end(), current2.begin(), ::tolower);
+
+                if(current == startName){
+                    startTime = iter->second;
+                     animate = loops;
+                     time = startTime;
+                     first = true;
+                }
+                if(current2 == stopName){
+                    stopTime = iter->second;
+                    if(first)
+                        break;
+                }
+                }
+            }
+            if(!first){
+                startName = groupname + ": start";
+                stopName = groupname + ": stop";
+
+            for(std::map<std::string, float>::iterator iter = textmappings->begin(); iter != textmappings->end(); iter++){
+
+                std::string current = iter->first.substr(0, startName.size());
+                std::transform(current.begin(), current.end(), current.begin(), ::tolower);
+                std::string current2 = iter->first.substr(0, stopName.size());
+                std::transform(current2.begin(), current2.end(), current2.begin(), ::tolower);
+
+                if(current == startName){
+                    startTime = iter->second;
+                     animate = loops;
+                     time = startTime;
+                     first = true;
+                }
+                if(current2 == stopName){
+                    stopTime = iter->second;
+                    if(first)
+                        break;
+                }
+            }
+            }
+
+        }
+
+	}
+    void Animation::stopScript(){
+        animate = 0;
+    }
+
+   void Animation::handleShapes(std::vector<Nif::NiTriShapeCopy>* allshapes, Ogre::Entity* creaturemodel, Ogre::SkeletonInstance *skel){
+        shapeNumber = 0;
+
+        std::vector<Nif::NiTriShapeCopy>::iterator allshapesiter;
+	    for(allshapesiter = allshapes->begin(); allshapesiter != allshapes->end(); allshapesiter++)
+
+                {
+                    //std::map<unsigned short, PosAndRot> vecPosRot;
+
+			Nif::NiTriShapeCopy& copy = *allshapesiter;
+			std::vector<Ogre::Vector3>* allvertices = &copy.vertices;
+			std::vector<Ogre::Vector3>* allnormals = &copy.normals;
+
+
+
+			//std::set<unsigned int> vertices;
+			//std::set<unsigned int> normals;
+			//std::vector<Nif::NiSkinData::BoneInfoCopy> boneinfovector =  copy.boneinfo;
+            std::map<int, std::vector<Nif::NiSkinData::IndividualWeight> >* verticesToChange = &copy.vertsToWeights;
+
+			//std::cout << "Name " << copy.sname << "\n";
+			Ogre::HardwareVertexBufferSharedPtr vbuf = creaturemodel->getMesh()->getSubMesh(copy.sname)->vertexData->vertexBufferBinding->getBuffer(0);
+		            Ogre::Real* pReal = static_cast<Ogre::Real*>(vbuf->lock(Ogre::HardwareBuffer::HBL_NORMAL));
+
+
+				std::vector<Ogre::Vector3> initialVertices = copy.morph.getInitialVertices();
+				//Each shape has multiple indices
+				if(initialVertices.size() )
+				{
+
+					if(copy.vertices.size() == initialVertices.size())
+					{
+						//Create if it doesn't already exist
+						if(shapeIndexI.size() == static_cast<std::size_t> (shapeNumber))
+						{
+							std::vector<int> vec;
+							shapeIndexI.push_back(vec);
+						}
+                        if(time >= copy.morph.getStartTime() && time <= copy.morph.getStopTime()){
+						float x;
+						for (unsigned int i = 0; i < copy.morph.getAdditionalVertices().size(); i++){
+							int j = 0;
+							if(shapeIndexI[shapeNumber].size() <= i)
+								shapeIndexI[shapeNumber].push_back(0);
+
+
+							if(timeIndex(time,copy.morph.getRelevantTimes()[i],(shapeIndexI[shapeNumber])[i], j, x)){
+							int indexI = (shapeIndexI[shapeNumber])[i];
+							std::vector<Ogre::Vector3> relevantData = (copy.morph.getRelevantData()[i]);
+							float v1 = relevantData[indexI].x;
+							float v2 = relevantData[j].x;
+							float t = v1 + (v2 - v1) * x;
+							if ( t < 0 ) t = 0;
+							if ( t > 1 ) t = 1;
+						    if( t != 0 && initialVertices.size() == copy.morph.getAdditionalVertices()[i].size())
+							{
+								for (unsigned int v = 0; v < initialVertices.size(); v++){
+									initialVertices[v] += ((copy.morph.getAdditionalVertices()[i])[v]) * t;
+								}
+							}
+
+							}
+
+
+
+						}
+
+						allvertices = &initialVertices;
+                        }
+						shapeNumber++;
+					}
+				}
+
+
+			    if(verticesToChange->size() > 0){
+
+                for(std::map<int, std::vector<Nif::NiSkinData::IndividualWeight> >::iterator iter = verticesToChange->begin();
+                    iter != verticesToChange->end(); iter++)
+                {
+                    std::vector<Nif::NiSkinData::IndividualWeight> inds = iter->second;
+                    int verIndex = iter->first;
+                    Ogre::Vector3 currentVertex = (*allvertices)[verIndex];
+                    Ogre::Vector3 currentNormal = (*allnormals)[verIndex];
+                    Nif::NiSkinData::BoneInfoCopy* boneinfocopy = &(allshapesiter->boneinfo[inds[0].boneinfocopyindex]);
+                    Ogre::Bone *bonePtr = 0;
+
+
+
+                    Ogre::Vector3 vecPos;
+                    Ogre::Quaternion vecRot;
+					std::map<Nif::NiSkinData::BoneInfoCopy*, PosAndRot>::iterator result = vecRotPos.find(boneinfocopy);
+
+                    if(result == vecRotPos.end()){
+                        bonePtr = skel->getBone(boneinfocopy->bonename);
+
+                        vecPos = bonePtr->_getDerivedPosition() + bonePtr->_getDerivedOrientation() * boneinfocopy->trafo.trans;
+                        vecRot = bonePtr->_getDerivedOrientation() * boneinfocopy->trafo.rotation;
+
+
+                             PosAndRot both;
+                            both.vecPos = vecPos;
+                            both.vecRot = vecRot;
+                            vecRotPos[boneinfocopy] = both;
+
+                    }
+                    else{
+                        PosAndRot both = result->second;
+                        vecPos = both.vecPos;
+                        vecRot = both.vecRot;
+                    }
+
+                    Ogre::Vector3 absVertPos = (vecPos + vecRot * currentVertex) * inds[0].weight;
+
+
+
+                    for(std::size_t i = 1; i < inds.size(); i++){
+                        boneinfocopy = &(allshapesiter->boneinfo[inds[i].boneinfocopyindex]);
+                        result = vecRotPos.find(boneinfocopy);
+
+
+                        if(result == vecRotPos.end()){
+                            bonePtr = skel->getBone(boneinfocopy->bonename);
+                            vecPos = bonePtr->_getDerivedPosition() + bonePtr->_getDerivedOrientation() * boneinfocopy->trafo.trans;
+                            vecRot = bonePtr->_getDerivedOrientation() * boneinfocopy->trafo.rotation;
+
+                                PosAndRot both;
+                                both.vecPos = vecPos;
+                                both.vecRot = vecRot;
+                                vecRotPos[boneinfocopy] = both;
+
+                        }
+                         else{
+                                PosAndRot both = result->second;
+                                vecPos = both.vecPos;
+                                vecRot = both.vecRot;
+                        }
+
+
+                        absVertPos += (vecPos + vecRot * currentVertex) * inds[i].weight;
+
+
+                    }
+                     Ogre::Real* addr = (pReal + 3 * verIndex);
+							  *addr = absVertPos.x;
+							  *(addr+1) = absVertPos.y;
+				              *(addr+2) = absVertPos.z;
+
+                }
+
+
+
+
+				}
+				else
+				{
+					//Ogre::Bone *bonePtr = creaturemodel->getSkeleton()->getBone(copy.bonename);
+					Ogre::Quaternion shaperot = copy.trafo.rotation;
+					Ogre::Vector3 shapetrans = copy.trafo.trans;
+					float shapescale = copy.trafo.scale;
+					std::vector<std::string> boneSequence = copy.boneSequence;
+
+					Ogre::Vector3 transmult;
+						Ogre::Quaternion rotmult;
+						float scale;
+					if(boneSequence.size() > 0){
+                        std::vector<std::string>::iterator boneSequenceIter = boneSequence.begin();
+                        if(skel->hasBone(*boneSequenceIter)){
+					Ogre::Bone *bonePtr = skel->getBone(*boneSequenceIter);
+
+
+
+
+						transmult = bonePtr->getPosition();
+						rotmult = bonePtr->getOrientation();
+						scale = bonePtr->getScale().x;
+						boneSequenceIter++;
+					    for(; boneSequenceIter != boneSequence.end(); boneSequenceIter++)
+					    {
+							if(creaturemodel->getSkeleton()->hasBone(*boneSequenceIter)){
+							Ogre::Bone *bonePtr = creaturemodel->getSkeleton()->getBone(*boneSequenceIter);
+								// Computes C = B + AxC*scale
+								transmult = transmult + rotmult * bonePtr->getPosition();
+								rotmult = rotmult * bonePtr->getOrientation();
+								scale = scale * bonePtr->getScale().x;
+							}
+						    //std::cout << "Bone:" << *boneSequenceIter << "   ";
+					    }
+						transmult = transmult + rotmult * shapetrans;
+						rotmult = rotmult * shaperot;
+						scale = shapescale * scale;
+
+						//std::cout << "Position: " << transmult << "Rotation: " << rotmult << "\n";
+					}
+                    }
+					else
+					{
+						transmult = shapetrans;
+						rotmult = shaperot;
+						scale = shapescale;
+					}
+
+
+
+
+					// Computes C = B + AxC*scale
+					 // final_vector = old_vector + old_rotation*new_vector*old_scale/
+
+					for(unsigned int i = 0; i < allvertices->size(); i++){
+						Ogre::Vector3 current = transmult + rotmult * (*allvertices)[i];
+						Ogre::Real* addr = pReal + i * 3;
+					    *addr = current.x;
+						*(addr+1) = current.y;
+						*(addr + 2) = current.z;
+
+					}/*
+					for(int i = 0; i < allnormals.size(); i++){
+						Ogre::Vector3 current =rotmult * allnormals[i];
+						Ogre::Real* addr = pRealNormal + i * 3;
+					    *addr = current.x;
+						*(addr+1) = current.y;
+						*(addr + 2) = current.z;
+
+					}*/
+
+				}
+				vbuf->unlock();
+
+		}
+
+    }
+    bool Animation::timeIndex( float time, std::vector<float> times, int & i, int & j, float & x ){
+	int count;
+	if (  (count = times.size()) > 0 )
+	{
+		if ( time <= times[0] )
+		{
+			i = j = 0;
+			x = 0.0;
+			return true;
+		}
+		if ( time >= times[count - 1] )
+		{
+			i = j = count - 1;
+			x = 0.0;
+			return true;
+		}
+
+		if ( i < 0 || i >= count )
+			i = 0;
+
+		float tI = times[i];
+		if ( time > tI )
+		{
+			j = i + 1;
+			float tJ;
+			while ( time >= ( tJ = times[j]) )
+			{
+				i = j++;
+				tI = tJ;
+			}
+			x = ( time - tI ) / ( tJ - tI );
+			return true;
+		}
+		else if ( time < tI )
+		{
+			j = i - 1;
+			float tJ;
+			while ( time <= ( tJ = times[j] ) )
+			{
+				i = j--;
+				tI = tJ;
+			}
+			x = ( time - tI ) / ( tJ - tI );
+			return true;
+		}
+		else
+		{
+			j = i;
+			x = 0.0;
+			return true;
+		}
+	}
+	else
+		return false;
+
+}
+
+ void Animation::handleAnimationTransforms(){
+    Ogre::SkeletonInstance* skel = base->getSkeleton();
+
+
+    Ogre::Bone* b = skel->getRootBone();
+	    b->setOrientation(Ogre::Real(.3),Ogre::Real(.3),Ogre::Real(.3), Ogre::Real(.3));   //This is a trick
+
+        skel->_updateTransforms();
+	    //skel->_notifyManualBonesDirty();
+
+         base->getAllAnimationStates()->_notifyDirty();
+     //base->_updateAnimation();
+   //base->_notifyMoved();
+
+   for(unsigned int i = 0; i < entityparts.size(); i++){
+         //Ogre::SkeletonInstance* skel = entityparts[i]->getSkeleton();
+
+        Ogre::Bone* b = skel->getRootBone();
+	   b->setOrientation(Ogre::Real(.3),Ogre::Real(.3),Ogre::Real(.3), Ogre::Real(.3));//This is a trick
+
+         entityparts[i]->getAllAnimationStates()->_notifyDirty();
+    }
+
+
+    std::vector<Nif::NiKeyframeData>::iterator iter;
+    int slot = 0;
+    if(transformations){
+    for(iter = transformations->begin(); iter != transformations->end(); iter++){
+        if(time < iter->getStartTime() || time < startTime || time > iter->getStopTime())
+	    {
+            slot++;
+		    continue;
+	    }
+
+         float x;
+		float x2;
+
+	    std::vector<Ogre::Quaternion> quats = iter->getQuat();
+
+        std::vector<float> ttime = iter->gettTime();
+        std::vector<float>::iterator ttimeiter = ttime.begin();
+
+        std::vector<float> rtime = iter->getrTime();
+        int rindexJ = 0;
+	    timeIndex(time, rtime, rindexI[slot], rindexJ, x2);
+	    int tindexJ = 0;
+
+
+        std::vector<Ogre::Vector3> translist1 = iter->getTranslist1();
+
+        timeIndex(time, ttime, tindexI[slot], tindexJ, x);
+
+        Ogre::Vector3 t;
+        Ogre::Quaternion r;
+
+        bool bTrans = translist1.size() > 0;
+	    if(bTrans){
+            Ogre::Vector3 v1 = translist1[tindexI[slot]];
+            Ogre::Vector3 v2 = translist1[tindexJ];
+           t = (v1 + (v2 - v1) * x);
+
+	    }
+
+        bool bQuats = quats.size() > 0;
+	    if(bQuats){
+		    r = Ogre::Quaternion::Slerp(x2, quats[rindexI[slot]], quats[rindexJ], true);
+	    }
+        skel = base->getSkeleton();
+    if(skel->hasBone(iter->getBonename())){
+        Ogre::Bone* bone = skel->getBone(iter->getBonename());
+        if(bTrans)
+            bone->setPosition(t);
+        if(bQuats)
+            bone->setOrientation(r);
+
+
+
+        skel->_updateTransforms();
+        base->getAllAnimationStates()->_notifyDirty();
+
+	}
+
+    slot++;
+    }
+}
+}
+
+}
diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp
new file mode 100644
index 0000000000..bad7eca15e
--- /dev/null
+++ b/apps/openmw/mwrender/animation.hpp
@@ -0,0 +1,72 @@
+#ifndef _GAME_RENDER_ANIMATION_H
+#define _GAME_RENDER_ANIMATION_H
+#include <components/nif/data.hpp>
+#include <openengine/ogre/renderer.hpp>
+#include "../mwworld/refdata.hpp"
+#include "../mwworld/ptr.hpp"
+#include "../mwworld/actiontalk.hpp"
+#include "../mwworld/environment.hpp"
+#include <components/nif/node.hpp>
+#include <map>
+#include <openengine/bullet/physic.hpp>
+
+
+
+
+namespace MWRender{
+
+struct PosAndRot{
+    Ogre::Quaternion vecRot;
+    Ogre::Vector3 vecPos;
+};
+
+class Animation{
+    
+   protected:
+    Ogre::SceneNode* insert;
+    OEngine::Render::OgreRenderer &mRend;
+    MWWorld::Environment& mEnvironment;
+    std::map<Nif::NiSkinData::BoneInfoCopy*, PosAndRot> vecRotPos;
+    static std::map<std::string, int> mUniqueIDs;
+    
+   
+    std::vector<std::vector<Nif::NiTriShapeCopy>* > shapeparts;   //All the NiTriShape data that we need for animating an npc
+
+    float time;
+	float startTime;
+	float stopTime;
+	int animate;
+	//Represents a rotation index for each bone
+	std::vector<int>rindexI;
+    //Represents a translation index for each bone
+	std::vector<int>tindexI;
+	
+	//Only shapes with morphing data will use a shape number
+	int shapeNumber;
+	std::vector<std::vector<int> > shapeIndexI;
+
+	//Ogre::SkeletonInstance* skel;
+     std::vector<Nif::NiTriShapeCopy>* shapes;          //All the NiTriShapeData for a creature
+     std::vector<Ogre::Entity*> entityparts;
+
+
+    std::vector<Nif::NiKeyframeData>* transformations;
+    std::map<std::string,float>* textmappings;
+    Ogre::Entity* base;
+    void handleShapes(std::vector<Nif::NiTriShapeCopy>* allshapes, Ogre::Entity* creaturemodel, Ogre::SkeletonInstance *skel);
+    void handleAnimationTransforms();
+    bool timeIndex( float time, std::vector<float> times, int & i, int & j, float & x );
+    std::string getUniqueID(std::string mesh);
+	
+    public:
+     Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend): mRend(_rend), mEnvironment(_env), animate(0){};
+	 virtual void runAnimation(float timepassed) = 0;
+	 void startScript(std::string groupname, int mode, int loops);
+     void stopScript();
+    
+    
+     ~Animation();
+ 
+};
+}
+#endif
\ No newline at end of file
diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp
new file mode 100644
index 0000000000..4de6453aa6
--- /dev/null
+++ b/apps/openmw/mwrender/creatureanimation.cpp
@@ -0,0 +1,63 @@
+#include "creatureanimation.hpp"
+
+#include "../mwworld/world.hpp"
+
+using namespace Ogre;
+using namespace NifOgre;
+namespace MWRender{
+
+CreatureAnimation::~CreatureAnimation(){
+
+}
+CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,OEngine::Render::OgreRenderer& _rend): Animation(_env,_rend){
+    insert = ptr.getRefData().getBaseNode();
+    ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
+            ptr.get<ESM::Creature>();
+
+    assert (ref->base != NULL);
+    if(!ref->base->model.empty()){
+        const std::string &mesh = "meshes\\" + ref->base->model;
+        std::string meshNumbered = mesh + getUniqueID(mesh) + ">|";
+        NifOgre::NIFLoader::load(meshNumbered);
+        base = mRend.getScene()->createEntity(meshNumbered);
+        std::string meshZero = mesh + "0000>|";
+
+        if((transformations = (NIFLoader::getSingletonPtr())->getAnim(meshZero))){
+
+        for(std::size_t init = 0; init < transformations->size(); init++){
+				rindexI.push_back(0);
+				tindexI.push_back(0);
+			}
+        stopTime = transformations->begin()->getStopTime();
+		startTime = transformations->begin()->getStartTime();
+		shapes = (NIFLoader::getSingletonPtr())->getShapes(meshZero);
+        }
+        textmappings = NIFLoader::getSingletonPtr()->getTextIndices(meshZero);
+        insert->attachObject(base);
+    }
+}
+
+void CreatureAnimation::runAnimation(float timepassed){
+    vecRotPos.clear();
+	if(animate > 0){
+		//Add the amount of time passed to time
+
+		//Handle the animation transforms dependent on time
+
+		//Handle the shapes dependent on animation transforms
+        time += timepassed;
+        if(time >= stopTime){
+            animate--;
+            //std::cout << "Stopping the animation\n";
+            if(animate == 0)
+                time = stopTime;
+            else
+                time = startTime + (time - stopTime);
+        }
+
+        handleAnimationTransforms();
+        handleShapes(shapes, base, base->getSkeleton());
+
+	}
+}
+}
diff --git a/apps/openmw/mwrender/creatureanimation.hpp b/apps/openmw/mwrender/creatureanimation.hpp
new file mode 100644
index 0000000000..179991442c
--- /dev/null
+++ b/apps/openmw/mwrender/creatureanimation.hpp
@@ -0,0 +1,26 @@
+#ifndef _GAME_RENDER_CREATUREANIMATION_H
+#define _GAME_RENDER_CREATUREANIMATION_H
+
+#include "animation.hpp"
+#include <components/nif/node.hpp>
+
+
+#include "../mwworld/refdata.hpp"
+#include "../mwworld/ptr.hpp"
+#include "../mwworld/environment.hpp"
+#include "components/nifogre/ogre_nif_loader.hpp"
+
+
+namespace MWRender{
+
+class CreatureAnimation: public Animation{
+   
+    public:
+    ~CreatureAnimation();
+    CreatureAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend);
+	virtual void runAnimation(float timepassed);
+	
+
+};
+}
+#endif
\ No newline at end of file
diff --git a/apps/openmw/mwrender/creatures.cpp b/apps/openmw/mwrender/creatures.cpp
deleted file mode 100644
index 9989512492..0000000000
--- a/apps/openmw/mwrender/creatures.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "creatures.hpp"
-using namespace MWRender;
\ No newline at end of file
diff --git a/apps/openmw/mwrender/creatures.hpp b/apps/openmw/mwrender/creatures.hpp
deleted file mode 100644
index 9aabb175bf..0000000000
--- a/apps/openmw/mwrender/creatures.hpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _GAME_RENDER_CREATURES_H
-#define _GAME_RENDER_CREATURES_H
-#include <openengine/ogre/renderer.hpp>
-
-namespace MWRender{
-class Creatures{
-
-};
-}
-#endif
\ No newline at end of file
diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp
new file mode 100644
index 0000000000..4c9c0e4665
--- /dev/null
+++ b/apps/openmw/mwrender/npcanimation.cpp
@@ -0,0 +1,282 @@
+#include "npcanimation.hpp"
+#include "../mwworld/world.hpp"
+
+
+using namespace Ogre;
+using namespace NifOgre;
+namespace MWRender{
+NpcAnimation::~NpcAnimation(){
+
+}
+
+
+NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,OEngine::Render::OgreRenderer& _rend): Animation(_env,_rend){
+     ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
+            ptr.get<ESM::NPC>();
+
+		//Part selection on last character of the file string
+		//  " Tri Chest
+		//  * Tri Tail
+		//  : Tri Left Foot
+		//  < Tri Right Foot
+		//  > Tri Left Hand
+		//  ? Tri Right Hand
+		//  | Normal
+
+		//Mirroring Parts on second to last character
+		//suffix == '*'
+		//	vector = Ogre::Vector3(-1,1,1);
+		//  suffix == '?'
+		//	vector = Ogre::Vector3(1,-1,1);
+		//  suffix == '<'
+		//	vector = Ogre::Vector3(1,1,-1);
+
+
+		std::string hairID = ref->base->hair;
+        std::string headID = ref->base->head;
+		std::string npcName = ref->base->name;
+        //ESMStore::Races r =
+        const ESM::Race* race = mEnvironment.mWorld->getStore().races.find(ref->base->race);
+
+
+         std::string bodyRaceID = headID.substr(0, headID.find_last_of("head_") - 4);
+		char secondtolast = bodyRaceID.at(bodyRaceID.length() - 2);
+		bool female = tolower(secondtolast) == 'f';
+		bool beast = bodyRaceID == "b_n_khajiit_m_" || bodyRaceID == "b_n_khajiit_f_" || bodyRaceID == "b_n_argonian_m_" || bodyRaceID == "b_n_argonian_f_";
+
+        /*std::cout << "Race: " << ref->base->race ;
+        if(female){
+           std::cout << " Sex: Female" << " Height: " << race->data.height.female << "\n";
+        }
+        else{
+             std::cout << " Sex: Male" << " Height: " << race->data.height.male << "\n";
+        }*/
+
+
+
+        std::string smodel = "meshes\\base_anim.nif";
+		if(beast)
+			smodel = "meshes\\base_animkna.nif";
+
+         insert = ptr.getRefData().getBaseNode();
+         assert(insert);
+
+         NifOgre::NIFLoader::load(smodel);
+
+    base = mRend.getScene()->createEntity(smodel);
+    base->setSkipAnimationStateUpdate(true);   //Magical line of code, this makes the bones
+                                               //stay in the same place when we skipanim, or open a gui window
+
+
+
+    if((transformations = (NIFLoader::getSingletonPtr())->getAnim(smodel))){
+
+        for(unsigned int init = 0; init < transformations->size(); init++){
+				rindexI.push_back(0);
+				tindexI.push_back(0);
+			}
+
+        stopTime = transformations->begin()->getStopTime();
+		startTime = transformations->begin()->getStartTime();
+    }
+    textmappings = NIFLoader::getSingletonPtr()->getTextIndices(smodel);
+    insert->attachObject(base);
+
+        if(female)
+            insert->scale(race->data.height.female, race->data.height.female, race->data.height.female);
+        else
+            insert->scale(race->data.height.male, race->data.height.male, race->data.height.male);
+        std::string headModel = "meshes\\" +
+            mEnvironment.mWorld->getStore().bodyParts.find(headID)->model;
+
+		std::string hairModel = "meshes\\" +
+            mEnvironment.mWorld->getStore().bodyParts.find(hairID)->model;
+        const ESM::BodyPart *chest = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "chest");
+        const ESM::BodyPart *upperleg = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "upper leg");
+		const ESM::BodyPart *groin = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "groin");
+		const ESM::BodyPart *arml = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "upper arm");  //We need two
+		const ESM::BodyPart *neck = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "neck");
+		const ESM::BodyPart *knee = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "knee");
+		const ESM::BodyPart *ankle = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "ankle");
+		const ESM::BodyPart *foot = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "foot");
+		const ESM::BodyPart *feet = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "feet");
+		const ESM::BodyPart *tail = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "tail");
+		const ESM::BodyPart *wristl = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "wrist");  //We need two
+		const ESM::BodyPart *forearml = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "forearm");  //We need two
+		const ESM::BodyPart *handl = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "hand");   //We need two
+		const ESM::BodyPart *hair = mEnvironment.mWorld->getStore().bodyParts.search(hairID);
+		const ESM::BodyPart *head = mEnvironment.mWorld->getStore().bodyParts.search(headID);
+        if(bodyRaceID == "b_n_argonian_f_")
+            forearml = mEnvironment.mWorld->getStore().bodyParts.search ("b_n_argonian_m_forearm");  //We need two
+		if(!handl)
+			handl = mEnvironment.mWorld->getStore().bodyParts.search (bodyRaceID + "hands");
+		//const ESM::BodyPart* claviclel = environment.mWorld->getStore().bodyParts.search (bodyRaceID + "clavicle");
+		//const ESM::BodyPart* clavicler = claviclel;
+		const ESM::BodyPart* handr = handl;
+		const ESM::BodyPart* forearmr = forearml;
+		const ESM::BodyPart* wristr = wristl;
+		const ESM::BodyPart* armr = arml;
+
+
+        if(upperleg){
+			insertBoundedPart("meshes\\" + upperleg->model + "*|", "Left Upper Leg");
+			insertBoundedPart("meshes\\" + upperleg->model, "Right Upper Leg");
+
+		}
+        if(foot){
+			if(bodyRaceID.compare("b_n_khajiit_m_") == 0)
+			{
+				feet = foot;
+			}
+			else
+			{
+				insertBoundedPart("meshes\\" + foot->model, "Right Foot");
+				insertBoundedPart("meshes\\" + foot->model + "*|", "Left Foot");
+			}
+		}
+        if(groin){
+			insertBoundedPart("meshes\\" + groin->model, "Groin");
+		}
+        if(knee)
+		{
+			insertBoundedPart("meshes\\" + knee->model + "*|", "Left Knee");  //e
+			insertBoundedPart("meshes\\" + knee->model, "Right Knee");   //e
+
+		}
+		if(ankle){
+
+			insertBoundedPart("meshes\\" + ankle->model + "*|", "Left Ankle"); //Ogre::Quaternion(Ogre::Radian(3.14 / 4), Ogre::Vector3(1, 0, 0)),blank); //1,0,0, blank);
+			insertBoundedPart("meshes\\" + ankle->model, "Right Ankle");
+		}
+        if (armr){
+			insertBoundedPart("meshes\\" + armr->model, "Right Upper Arm");
+		}
+		if(arml){
+			insertBoundedPart("meshes\\" + arml->model + "*|", "Left Upper Arm");
+		}
+
+		if (forearmr)
+		{
+				insertBoundedPart("meshes\\" + forearmr->model, "Right Forearm");
+		}
+		if(forearml)
+			insertBoundedPart("meshes\\" + forearml->model + "*|", "Left Forearm");
+
+		if (wristr)
+		{
+			insertBoundedPart("meshes\\" + wristr->model, "Right Wrist");
+		}
+
+		if(wristl)
+				insertBoundedPart("meshes\\" + wristl->model + "*|", "Left Wrist");
+
+
+
+
+
+		/*if(claviclel)
+			insertBoundedPart("meshes\\" + claviclel->model + "*|", "Left Clavicle", base);
+		if(clavicler)
+			insertBoundedPart("meshes\\" + clavicler->model , "Right Clavicle", base);*/
+
+		if(neck)
+		{
+			insertBoundedPart("meshes\\" + neck->model, "Neck");
+		}
+		if(head)
+			insertBoundedPart("meshes\\" + head->model, "Head");
+		if(hair)
+			insertBoundedPart("meshes\\" + hair->model, "Head");
+
+        if (chest){
+				insertFreePart("meshes\\" + chest->model, ">\"", insert);
+
+
+		}
+        if (handr){
+				insertFreePart("meshes\\" + handr->model , ">?", insert);
+
+		}
+        if (handl){
+				insertFreePart("meshes\\" + handl->model, ">>", insert);
+
+		}
+        if(tail){
+                insertFreePart("meshes\\" + tail->model, ">*", insert);
+        }
+        if(feet){
+                std::string num = getUniqueID(feet->model);
+                insertFreePart("meshes\\" + feet->model,"><", insert);
+                insertFreePart("meshes\\" + feet->model,">:", insert);
+        }
+        //originalpos = insert->_getWorldAABB().getCenter();
+        //originalscenenode = insert->getPosition();
+}
+
+Ogre::Entity* NpcAnimation::insertBoundedPart(const std::string &mesh, std::string bonename){
+   
+    NIFLoader::load(mesh);
+    Entity* ent = mRend.getScene()->createEntity(mesh);
+
+    base->attachObjectToBone(bonename, ent);
+    return ent;
+}
+void NpcAnimation::insertFreePart(const std::string &mesh, const std::string suffix, Ogre::SceneNode* insert){
+    std::string meshNumbered = mesh + getUniqueID(mesh + suffix) + suffix;
+    NIFLoader::load(meshNumbered);
+
+    Ogre::Entity* ent = mRend.getScene()->createEntity(meshNumbered);
+
+     
+
+
+    insert->attachObject(ent);
+    entityparts.push_back(ent);
+    shapes = ((NIFLoader::getSingletonPtr())->getShapes(mesh + "0000" + suffix));
+    if(shapes){
+        shapeparts.push_back(shapes);
+        handleShapes(shapes, ent, base->getSkeleton());
+    }
+
+
+}
+
+
+void NpcAnimation::runAnimation(float timepassed){
+    
+    //1. Add the amount of time passed to time
+
+	//2. Handle the animation transforms dependent on time
+
+	//3. Handle the shapes dependent on animation transforms
+	if(animate > 0){
+        time += timepassed;
+
+        if(time > stopTime){
+            animate--;
+
+            if(animate == 0)
+                time = stopTime;
+            else
+                time = startTime + (time - stopTime);
+        }
+
+        handleAnimationTransforms();
+
+        std::vector<std::vector<Nif::NiTriShapeCopy>*>::iterator shapepartsiter = shapeparts.begin();
+        std::vector<Ogre::Entity*>::iterator entitypartsiter = entityparts.begin();
+        while(shapepartsiter != shapeparts.end())
+        {
+            vecRotPos.clear();
+            std::vector<Nif::NiTriShapeCopy>* shapes = *shapepartsiter;
+            Ogre::Entity* theentity = *entitypartsiter;
+
+
+            handleShapes(shapes, theentity, base->getSkeleton());
+            shapepartsiter++;
+            entitypartsiter++;
+        }
+    }
+
+}
+}
diff --git a/apps/openmw/mwrender/npcanimation.hpp b/apps/openmw/mwrender/npcanimation.hpp
new file mode 100644
index 0000000000..e8ce735f79
--- /dev/null
+++ b/apps/openmw/mwrender/npcanimation.hpp
@@ -0,0 +1,30 @@
+#ifndef _GAME_RENDER_NPCANIMATION_H
+#define _GAME_RENDER_NPCANIMATION_H
+#include "animation.hpp"
+#include <components/nif/data.hpp>
+#include <components/nif/node.hpp>
+#include <components/nif/property.hpp>
+#include <components/nif/controller.hpp>
+#include <components/nif/extra.hpp>
+
+#include "../mwworld/refdata.hpp"
+#include "../mwworld/ptr.hpp"
+#include "../mwworld/environment.hpp"
+#include "components/nifogre/ogre_nif_loader.hpp"
+
+namespace MWRender{
+
+class NpcAnimation: public Animation{
+    
+    
+    
+    public:
+     NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend);
+     ~NpcAnimation();
+    Ogre::Entity* insertBoundedPart(const std::string &mesh, std::string bonename);
+    void insertFreePart(const std::string &mesh, const std::string suffix, Ogre::SceneNode* insert);
+	virtual void runAnimation(float timepassed);
+	
+};
+}
+#endif
\ No newline at end of file
diff --git a/apps/openmw/mwrender/npcs.cpp b/apps/openmw/mwrender/npcs.cpp
deleted file mode 100644
index 7012ccb184..0000000000
--- a/apps/openmw/mwrender/npcs.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "npcs.hpp"
-using namespace MWRender;
diff --git a/apps/openmw/mwrender/npcs.hpp b/apps/openmw/mwrender/npcs.hpp
deleted file mode 100644
index 88ee5ca309..0000000000
--- a/apps/openmw/mwrender/npcs.hpp
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _GAME_RENDER_NPCS_H
-#define _GAME_RENDER_NPCS_H
-#include <openengine/ogre/renderer.hpp>
-namespace MWRender{
-class Npcs{
-
-};
-}
-#endif
diff --git a/apps/openmw/mwrender/objects.cpp b/apps/openmw/mwrender/objects.cpp
index 757d86f3b9..4e2a3caab2 100644
--- a/apps/openmw/mwrender/objects.cpp
+++ b/apps/openmw/mwrender/objects.cpp
@@ -1,11 +1,11 @@
 #include "objects.hpp"
+
 #include <OgreSceneNode.h>
+
 #include <components/nifogre/ogre_nif_loader.hpp>
 
-using namespace Ogre;
 using namespace MWRender;
 
-
 bool Objects::lightConst = false;
 float Objects::lightConstValue = 0.0f;
 
@@ -23,11 +23,25 @@ bool Objects::lightOutQuadInLin = false;
 
 int Objects::uniqueID = 0;
 
-void Objects::setMwRoot(Ogre::SceneNode* root){
-    mwRoot = root;
+void Objects::clearSceneNode (Ogre::SceneNode *node)
+{
+    /// \todo This should probably be moved into OpenEngine at some point.
+    for (int i=node->numAttachedObjects()-1; i>=0; --i)
+    {
+        Ogre::MovableObject *object = node->getAttachedObject (i);
+        node->detachObject (object);
+        mRenderer.getScene()->destroyMovableObject (object);
+    }
 }
-void Objects::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_){
-    Ogre::SceneNode* root = mwRoot;
+
+void Objects::setMwRoot(Ogre::SceneNode* root)
+{
+    mMwRoot = root;
+}
+
+void Objects::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_)
+{
+    Ogre::SceneNode* root = mMwRoot;
     Ogre::SceneNode* cellnode;
     if(mCellSceneNodes.find(ptr.getCell()) == mCellSceneNodes.end())
     {
@@ -49,90 +63,91 @@ void Objects::insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_){
     f = ptr.getCellRef().pos.rot;
 
     // Rotate around X axis
-    Quaternion xr(Radian(-f[0]), Vector3::UNIT_X);
+    Ogre::Quaternion xr(Ogre::Radian(-f[0]), Ogre::Vector3::UNIT_X);
 
     // Rotate around Y axis
-    Quaternion yr(Radian(-f[1]), Vector3::UNIT_Y);
+    Ogre::Quaternion yr(Ogre::Radian(-f[1]), Ogre::Vector3::UNIT_Y);
 
     // Rotate around Z axis
-    Quaternion zr(Radian(-f[2]), Vector3::UNIT_Z);
+    Ogre::Quaternion zr(Ogre::Radian(-f[2]), Ogre::Vector3::UNIT_Z);
 
-   // Rotates first around z, then y, then x
+    // Rotates first around z, then y, then x
     insert->setOrientation(xr*yr*zr);
+
     if (!enabled)
          insert->setVisible (false);
     ptr.getRefData().setBaseNode(insert);
-    isStatic = static_;
-
-
+    mIsStatic = static_;
 }
-void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh){
+
+void Objects::insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh)
+{
     Ogre::SceneNode* insert = ptr.getRefData().getBaseNode();
     assert(insert);
 
     NifOgre::NIFLoader::load(mesh);
-    Entity *ent = mRend.getScene()->createEntity(mesh);
+    Ogre::Entity *ent = mRenderer.getScene()->createEntity(mesh);
 
-    if(!isStatic)
+    if(!mIsStatic)
     {
         insert->attachObject(ent);
     }
     else
     {
         Ogre::StaticGeometry* sg = 0;
-        if(mSG.find(ptr.getCell()) == mSG.end())
+        if(mStaticGeometry.find(ptr.getCell()) == mStaticGeometry.end())
         {
             uniqueID = uniqueID +1;
-            sg = mRend.getScene()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID));
+            sg = mRenderer.getScene()->createStaticGeometry( "sg" + Ogre::StringConverter::toString(uniqueID));
             //Create the scenenode and put it in the map
-            mSG[ptr.getCell()] = sg;
+            mStaticGeometry[ptr.getCell()] = sg;
         }
         else
         {
-            sg = mSG[ptr.getCell()];
+            sg = mStaticGeometry[ptr.getCell()];
         }
 
         sg->addEntity(ent,insert->_getDerivedPosition(),insert->_getDerivedOrientation(),insert->_getDerivedScale());
         sg->setRegionDimensions(Ogre::Vector3(100000,10000,100000));
 
-
-        mRend.getScene()->destroyEntity(ent);
+        mRenderer.getScene()->destroyEntity(ent);
     }
-
-
 }
-void Objects::insertLight (const MWWorld::Ptr& ptr, float r, float g, float b, float radius){
-    Ogre::SceneNode* insert = mRend.getScene()->getSceneNode(ptr.getRefData().getHandle());
+
+void Objects::insertLight (const MWWorld::Ptr& ptr, float r, float g, float b, float radius)
+{
+    Ogre::SceneNode* insert = mRenderer.getScene()->getSceneNode(ptr.getRefData().getHandle());
     assert(insert);
-    Ogre::Light *light = mRend.getScene()->createLight();
+    Ogre::Light *light = mRenderer.getScene()->createLight();
     light->setDiffuseColour (r, g, b);
 
     float cval=0.0f, lval=0.0f, qval=0.0f;
 
     if(lightConst)
          cval = lightConstValue;
-  if(!lightOutQuadInLin)
-  {
-    if(lightLinear)
-      radius *= lightLinearRadiusMult;
-    if(lightQuadratic)
-      radius *= lightQuadraticRadiusMult;
 
-    if(lightLinear)
-      lval = lightLinearValue / pow(radius, lightLinearMethod);
-    if(lightQuadratic)
-      qval = lightQuadraticValue / pow(radius, lightQuadraticMethod);
-  }
-  else
-  {
-    // FIXME:
-    // Do quadratic or linear, depending if we're in an exterior or interior
-    // cell, respectively. Ignore lightLinear and lightQuadratic.
-  }
+    if(!lightOutQuadInLin)
+    {
+        if(lightLinear)
+            radius *= lightLinearRadiusMult;
+        if(lightQuadratic)
+            radius *= lightQuadraticRadiusMult;
 
-  light->setAttenuation(10*radius, cval, lval, qval);
+        if(lightLinear)
+            lval = lightLinearValue / pow(radius, lightLinearMethod);
+        if(lightQuadratic)
+            qval = lightQuadraticValue / pow(radius, lightQuadraticMethod);
+    }
+    else
+    {
+        // FIXME:
+        // Do quadratic or linear, depending if we're in an exterior or interior
+        // cell, respectively. Ignore lightLinear and lightQuadratic.
+    }
 
-  insert->attachObject(light);
+    light->setAttenuation(10*radius, cval, lval, qval);
+
+    insert->attachObject(light);
 }
 
 bool Objects::deleteObject (const MWWorld::Ptr& ptr)
@@ -145,8 +160,9 @@ bool Objects::deleteObject (const MWWorld::Ptr& ptr)
             mCellSceneNodes.begin()); iter!=mCellSceneNodes.end(); ++iter)
             if (iter->second==parent)
             {
+                clearSceneNode (base);
                 base->removeAndDestroyAllChildren();
-                mRend.getScene()->destroySceneNode (base);
+                mRenderer.getScene()->destroySceneNode (base);
                 ptr.getRefData().setBaseNode (0);
                 return true;
             }
@@ -157,29 +173,35 @@ bool Objects::deleteObject (const MWWorld::Ptr& ptr)
     return true;
 }
 
-void Objects::removeCell(MWWorld::Ptr::CellStore* store){
+void Objects::removeCell(MWWorld::Ptr::CellStore* store)
+{
     if(mCellSceneNodes.find(store) != mCellSceneNodes.end())
     {
         Ogre::SceneNode* base = mCellSceneNodes[store];
+
+        for (int i=0; i<base->numChildren(); ++i)
+            clearSceneNode (static_cast<Ogre::SceneNode *> (base->getChild (i)));
+
         base->removeAndDestroyAllChildren();
         mCellSceneNodes.erase(store);
-        mRend.getScene()->destroySceneNode(base);
+        mRenderer.getScene()->destroySceneNode(base);
         base = 0;
     }
 
-
-    if(mSG.find(store) != mSG.end())
+    if(mStaticGeometry.find(store) != mStaticGeometry.end())
     {
-        Ogre::StaticGeometry* sg = mSG[store];
-        mSG.erase(store);
-        mRend.getScene()->destroyStaticGeometry (sg);
+        Ogre::StaticGeometry* sg = mStaticGeometry[store];
+        mStaticGeometry.erase(store);
+        mRenderer.getScene()->destroyStaticGeometry (sg);
         sg = 0;
     }
 }
-void Objects::buildStaticGeometry(ESMS::CellStore<MWWorld::RefData>& cell){
-    if(mSG.find(&cell) != mSG.end())
+
+void Objects::buildStaticGeometry(ESMS::CellStore<MWWorld::RefData>& cell)
+{
+    if(mStaticGeometry.find(&cell) != mStaticGeometry.end())
     {
-        Ogre::StaticGeometry* sg = mSG[&cell];
+        Ogre::StaticGeometry* sg = mStaticGeometry[&cell];
         sg->build();
     }
 }
diff --git a/apps/openmw/mwrender/objects.hpp b/apps/openmw/mwrender/objects.hpp
index 6f36e48497..d58455b9f3 100644
--- a/apps/openmw/mwrender/objects.hpp
+++ b/apps/openmw/mwrender/objects.hpp
@@ -1,20 +1,21 @@
 #ifndef _GAME_RENDER_OBJECTS_H
 #define _GAME_RENDER_OBJECTS_H
 
-#include "components/esm_store/cell_store.hpp"
+#include <openengine/ogre/renderer.hpp>
+
+#include <components/esm_store/cell_store.hpp>
 
 #include "../mwworld/refdata.hpp"
 #include "../mwworld/ptr.hpp"
-#include <openengine/ogre/renderer.hpp>
 
 namespace MWRender{
 
 class Objects{
-    OEngine::Render::OgreRenderer &mRend;
+    OEngine::Render::OgreRenderer &mRenderer;
     std::map<MWWorld::Ptr::CellStore *, Ogre::SceneNode *> mCellSceneNodes;
-    std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mSG;
-    Ogre::SceneNode* mwRoot;
-    bool isStatic;
+    std::map<MWWorld::Ptr::CellStore *, Ogre::StaticGeometry*> mStaticGeometry;
+    Ogre::SceneNode* mMwRoot;
+    bool mIsStatic;
     static int uniqueID;
     static bool lightConst;
     static float lightConstValue;
@@ -30,8 +31,12 @@ class Objects{
     static float lightQuadraticRadiusMult;
 
     static bool lightOutQuadInLin;
+
+    void clearSceneNode (Ogre::SceneNode *node);
+    ///< Remove all movable objects from \a node.
+
 public:
-    Objects(OEngine::Render::OgreRenderer& _rend): mRend(_rend){}
+    Objects(OEngine::Render::OgreRenderer& renderer): mRenderer (renderer){}
     ~Objects(){}
     void insertBegin (const MWWorld::Ptr& ptr, bool enabled, bool static_);
     void insertMesh (const MWWorld::Ptr& ptr, const std::string& mesh);
diff --git a/apps/openmw/mwrender/renderinginterface.hpp b/apps/openmw/mwrender/renderinginterface.hpp
index ebd4af2bd3..03935bef60 100644
--- a/apps/openmw/mwrender/renderinginterface.hpp
+++ b/apps/openmw/mwrender/renderinginterface.hpp
@@ -1,16 +1,15 @@
 #ifndef _GAME_RENDERING_INTERFACE_H
 #define _GAME_RENDERING_INTERFACE_H
 namespace MWRender{
-      class Npcs;
-      class Creatures;
       class Objects;
+      class Actors;
       class Player;
+      
 class RenderingInterface{
     public:
-        virtual MWRender::Npcs& getNPCs() = 0;
-        virtual MWRender::Creatures& getCreatures() = 0;
         virtual MWRender::Objects& getObjects() = 0;
 	    virtual MWRender::Player& getPlayer() = 0;
+        virtual MWRender::Actors& getActors() = 0;
         virtual ~RenderingInterface(){};
     };
 }
diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp
index 471ce5c417..04ddc2cf86 100644
--- a/apps/openmw/mwrender/renderingmanager.cpp
+++ b/apps/openmw/mwrender/renderingmanager.cpp
@@ -19,14 +19,11 @@ using namespace Ogre;
 
 namespace MWRender {
 
-
-
-RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir, OEngine::Physic::PhysicEngine* engine)
-:rend(_rend), objects(rend), mDebugging(engine)
+RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir, OEngine::Physic::PhysicEngine* engine, MWWorld::Environment& environment)
+:mRendering(_rend), mObjects(mRendering), mActors(mRendering, environment), mAmbientMode(0), mDebugging(engine)
 {
-    rend.createScene("PlayerCam", 55, 5);
-    mSkyManager = MWRender::SkyManager::create(rend.getWindow(), rend.getCamera(), resDir);
-    mTerrainManager = new TerrainManager(rend.getScene());
+    mRendering.createScene("PlayerCam", 55, 5);
+    mTerrainManager = new TerrainManager(mRendering.getScene());
 
     // Set default mipmap level (NB some APIs ignore this)
     TextureManager::getSingleton().setDefaultNumMipmaps(5);
@@ -39,52 +36,67 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
     // the screen (when x is to the right.) This is the orientation that
     // Morrowind uses, and it automagically makes everything work as it
     // should.
-    SceneNode *rt = rend.getScene()->getRootSceneNode();
-    mwRoot = rt->createChildSceneNode();
-    mwRoot->pitch(Degree(-90));
-    objects.setMwRoot(mwRoot);
-
+    SceneNode *rt = mRendering.getScene()->getRootSceneNode();
+    mMwRoot = rt->createChildSceneNode();
+    mMwRoot->pitch(Degree(-90));
+    mObjects.setMwRoot(mMwRoot);
+    mActors.setMwRoot(mMwRoot);
+        
     //used to obtain ingame information of ogre objects (which are faced or selected)
-    mRaySceneQuery = rend.getScene()->createRayQuery(Ray());
+    mRaySceneQuery = mRendering.getScene()->createRayQuery(Ray());
 
-    Ogre::SceneNode *playerNode = mwRoot->createChildSceneNode ("player");
+    Ogre::SceneNode *playerNode = mMwRoot->createChildSceneNode ("player");
     playerNode->pitch(Degree(90));
     Ogre::SceneNode *cameraYawNode = playerNode->createChildSceneNode();
     Ogre::SceneNode *cameraPitchNode = cameraYawNode->createChildSceneNode();
-    cameraPitchNode->attachObject(rend.getCamera());
+    cameraPitchNode->attachObject(mRendering.getCamera());
+    
+    //mSkyManager = 0;
+    mSkyManager = new SkyManager(mMwRoot, mRendering.getCamera());
 
-    mPlayer = new MWRender::Player (rend.getCamera(), playerNode);
+    mPlayer = new MWRender::Player (mRendering.getCamera(), playerNode);
+    mSun = 0;
 }
 
 RenderingManager::~RenderingManager ()
 {
+    //TODO: destroy mSun?
     delete mPlayer;
     delete mSkyManager;
     delete mTerrainManager;
 }
 
-MWRender::Npcs& RenderingManager::getNPCs(){
-    return npcs;
+MWRender::SkyManager* RenderingManager::getSkyManager()
+{
+    return mSkyManager;
 }
+
 MWRender::Objects& RenderingManager::getObjects(){
-    return objects;
+    return mObjects;
 }
-MWRender::Creatures& RenderingManager::getCreatures(){
-    return creatures;
+MWRender::Actors& RenderingManager::getActors(){
+    return mActors;
 }
+
 MWRender::Player& RenderingManager::getPlayer(){
     return (*mPlayer);
 }
 
+OEngine::Render::Fader* RenderingManager::getFader()
+{
+    return mRendering.getFader();
+}
+
 void RenderingManager::removeCell (MWWorld::Ptr::CellStore *store){
-    objects.removeCell(store);
+    mObjects.removeCell(store);
+    mActors.removeCell(store);
     if (store->cell->isExterior())
       mTerrainManager->cellRemoved(store);
 }
 
 void RenderingManager::cellAdded (MWWorld::Ptr::CellStore *store)
 {
-    objects.buildStaticGeometry (*store);
+    mObjects.buildStaticGeometry (*store);
     if (store->cell->isExterior())
       mTerrainManager->cellAdded(store);
 }
@@ -97,7 +109,11 @@ void RenderingManager::addObject (const MWWorld::Ptr& ptr){
 }
 void RenderingManager::removeObject (const MWWorld::Ptr& ptr)
 {
-    if (!objects.deleteObject (ptr))
+    if (!mObjects.deleteObject (ptr))
+    {
+        /// \todo delete non-object MW-references
+    }
+     if (!mActors.deleteObject (ptr))
     {
         /// \todo delete non-object MW-references
     }
@@ -106,7 +122,7 @@ void RenderingManager::removeObject (const MWWorld::Ptr& ptr)
 void RenderingManager::moveObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& position)
 {
     /// \todo move this to the rendering-subsystems
-    rend.getScene()->getSceneNode (ptr.getRefData().getHandle())->
+    mRendering.getScene()->getSceneNode (ptr.getRefData().getHandle())->
             setPosition (position);
 }
 
@@ -122,32 +138,41 @@ void RenderingManager::moveObjectToCell (const MWWorld::Ptr& ptr, const Ogre::Ve
 
 void RenderingManager::update (float duration){
 
-
+    mActors.update (duration);
+    
+    mSkyManager->update(duration);
+    
+    mRendering.update(duration);
 }
 
 void RenderingManager::skyEnable ()
 {
+    if(mSkyManager)
     mSkyManager->enable();
 }
 
 void RenderingManager::skyDisable ()
 {
-    mSkyManager->disable();
+    if(mSkyManager)
+        mSkyManager->disable();
 }
 
 void RenderingManager::skySetHour (double hour)
 {
-    mSkyManager->setHour(hour);
+    if(mSkyManager)
+        mSkyManager->setHour(hour);
 }
 
 
 void RenderingManager::skySetDate (int day, int month)
 {
-    mSkyManager->setDate(day, month);
+    if(mSkyManager)
+        mSkyManager->setDate(day, month);
 }
 
 int RenderingManager::skyGetMasserPhase() const
 {
+   
     return mSkyManager->getMasserPhase();
 }
 
@@ -156,12 +181,28 @@ int RenderingManager::skyGetSecundaPhase() const
     return mSkyManager->getSecundaPhase();
 }
 
-void RenderingManager::skySetMoonColour (bool red)
-{
-    mSkyManager->setMoonColour(red);
+void RenderingManager::skySetMoonColour (bool red){
+    if(mSkyManager)
+        mSkyManager->setMoonColour(red);
 }
-bool RenderingManager::toggleRenderMode(int mode){
-    return mDebugging.toggleRenderMode(mode);
+
+bool RenderingManager::toggleRenderMode(int mode)
+{
+    if (mode == MWWorld::World::Render_CollisionDebug)
+        return mDebugging.toggleRenderMode(mode);
+    else // if (mode == MWWorld::World::Render_Wireframe)
+    {
+        if (mRendering.getCamera()->getPolygonMode() == PM_SOLID)
+        {
+            mRendering.getCamera()->setPolygonMode(PM_WIREFRAME);
+            return true;
+        }
+        else
+        {
+            mRendering.getCamera()->setPolygonMode(PM_SOLID);
+            return false;
+        }
+    }
 }
 
 void RenderingManager::configureFog(ESMS::CellStore<MWWorld::RefData> &mCell)
@@ -169,31 +210,39 @@ void RenderingManager::configureFog(ESMS::CellStore<MWWorld::RefData> &mCell)
   Ogre::ColourValue color;
   color.setAsABGR (mCell.cell->ambi.fog);
 
-  float high = 4500 + 9000 * (1-mCell.cell->ambi.fogDensity);
-  float low = 200;
-
-  rend.getScene()->setFog (FOG_LINEAR, color, 0, low, high);
-  rend.getCamera()->setFarClipDistance (high + 10);
-  rend.getViewport()->setBackgroundColour (color);
+  configureFog(mCell.cell->ambi.fogDensity, color);
 }
 
+void RenderingManager::configureFog(const float density, const Ogre::ColourValue& colour)
+{  
+  /// \todo make the viewing distance and fog start/end configurable
+  float low = 3000 / density;
+  float high = 6200 / density;
+    
+  mRendering.getScene()->setFog (FOG_LINEAR, colour, 0, low, high);
+  
+  mRendering.getCamera()->setFarClipDistance ( high );
+  mRendering.getViewport()->setBackgroundColour (colour);
+}
+
+
 void RenderingManager::setAmbientMode()
 {
   switch (mAmbientMode)
   {
     case 0:
 
-      rend.getScene()->setAmbientLight(mAmbientColor);
+      mRendering.getScene()->setAmbientLight(mAmbientColor);
       break;
 
     case 1:
 
-      rend.getScene()->setAmbientLight(0.7f*mAmbientColor + 0.3f*ColourValue(1,1,1));
+      mRendering.getScene()->setAmbientLight(0.7f*mAmbientColor + 0.3f*ColourValue(1,1,1));
       break;
 
     case 2:
 
-      rend.getScene()->setAmbientLight(ColourValue(1,1,1));
+      mRendering.getScene()->setAmbientLight(ColourValue(1,1,1));
       break;
   }
 }
@@ -205,12 +254,15 @@ void RenderingManager::configureAmbient(ESMS::CellStore<MWWorld::RefData> &mCell
 
   // Create a "sun" that shines light downwards. It doesn't look
   // completely right, but leave it for now.
-  Ogre::Light *light = rend.getScene()->createLight();
+  if(!mSun)
+  {
+      mSun = mRendering.getScene()->createLight();
+  }
   Ogre::ColourValue colour;
   colour.setAsABGR (mCell.cell->ambi.sunlight);
-  light->setDiffuseColour (colour);
-  light->setType(Ogre::Light::LT_DIRECTIONAL);
-  light->setDirection(0,-1,0);
+  mSun->setDiffuseColour (colour);
+  mSun->setType(Ogre::Light::LT_DIRECTIONAL);
+  mSun->setDirection(0,-1,0);
 }
 // Switch through lighting modes.
 
@@ -231,6 +283,46 @@ void RenderingManager::toggleLight()
   setAmbientMode();
 }
 
-
-
+void RenderingManager::playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName,
+     int mode, int number)
+{
+    mActors.playAnimationGroup(ptr, groupName, mode, number);
 }
+
+void RenderingManager::skipAnimation (const MWWorld::Ptr& ptr)
+{
+    mActors.skipAnimation(ptr);
+}
+
+void RenderingManager::setSunColour(const Ogre::ColourValue& colour)
+{
+    mSun->setDiffuseColour(colour);
+}
+
+void RenderingManager::setAmbientColour(const Ogre::ColourValue& colour)
+{
+    mRendering.getScene()->setAmbientLight(colour);
+}
+
+void RenderingManager::sunEnable()
+{
+    if (mSun) mSun->setVisible(true);
+}
+
+void RenderingManager::sunDisable()
+{
+    if (mSun) mSun->setVisible(false);
+}
+
+void RenderingManager::setSunDirection(const Ogre::Vector3& direction)
+{
+    if (mSun) mSun->setDirection(Vector3(direction.x, -direction.z, direction.y));
+    mSkyManager->setSunDirection(direction);
+}
+
+void RenderingManager::setGlare(bool glare)
+{
+    mSkyManager->setGlare(glare);
+}
+
+} // namespace
diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp
index 5afbd9b78b..7eb9929301 100644
--- a/apps/openmw/mwrender/renderingmanager.hpp
+++ b/apps/openmw/mwrender/renderingmanager.hpp
@@ -10,6 +10,7 @@
 
 #include <utility>
 #include <openengine/ogre/renderer.hpp>
+#include <openengine/ogre/fader.hpp>
 #include <openengine/bullet/physic.hpp>
 
 #include <vector>
@@ -20,9 +21,9 @@
 #include <boost/filesystem.hpp>
 
 #include "renderinginterface.hpp"
-#include "npcs.hpp"
-#include "creatures.hpp"
+
 #include "objects.hpp"
+#include "actors.hpp"
 #include "player.hpp"
 
 namespace Ogre
@@ -50,20 +51,24 @@ class RenderingManager: private RenderingInterface {
 
   private:
 
-    virtual MWRender::Npcs& getNPCs();
-    virtual MWRender::Creatures& getCreatures();
+
     virtual MWRender::Objects& getObjects();
+    virtual MWRender::Actors& getActors();
 
   public:
-    RenderingManager(OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir, OEngine::Physic::PhysicEngine* engine);
+    RenderingManager(OEngine::Render::OgreRenderer& _rend, const boost::filesystem::path& resDir, OEngine::Physic::PhysicEngine* engine, MWWorld::Environment& environment);
     virtual ~RenderingManager();
 
     virtual MWRender::Player& getPlayer(); /// \todo move this to private again as soon as
                                             /// MWWorld::Player has been rewritten to not need access
                                             /// to internal details of the rendering system anymore
 
+    SkyManager* getSkyManager();
+
     void toggleLight();
     bool toggleRenderMode(int mode);
+    
+    OEngine::Render::Fader* getFader();
 
     void removeCell (MWWorld::Ptr::CellStore *store);
 
@@ -82,7 +87,14 @@ class RenderingManager: private RenderingInterface {
     void moveObjectToCell (const MWWorld::Ptr& ptr, const Ogre::Vector3& position, MWWorld::Ptr::CellStore *store);
 
     void update (float duration);
-
+    
+    void setAmbientColour(const Ogre::ColourValue& colour);
+    void setSunColour(const Ogre::ColourValue& colour);
+    void setSunDirection(const Ogre::Vector3& direction);
+    void sunEnable();
+    void sunDisable();
+    
+    void setGlare(bool glare);
     void skyEnable ();
     void skyDisable ();
     void skySetHour (double hour);
@@ -91,32 +103,50 @@ class RenderingManager: private RenderingInterface {
     int skyGetSecundaPhase() const;
     void skySetMoonColour (bool red);
     void configureAmbient(ESMS::CellStore<MWWorld::RefData> &mCell);
+    
     /// configure fog according to cell
     void configureFog(ESMS::CellStore<MWWorld::RefData> &mCell);
+    
+    /// configure fog manually
+    void configureFog(const float density, const Ogre::ColourValue& colour);
+    
+    void playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode,
+        int number = 1);
+    ///< Run animation for a MW-reference. Calls to this function for references that are currently not
+    /// in the rendered scene should be ignored.
+    ///
+    /// \param mode: 0 normal, 1 immediate start, 2 immediate loop
+    /// \param number How offen the animation should be run
+
+    void skipAnimation (const MWWorld::Ptr& ptr);
+    ///< Skip the animation for the given MW-reference for one frame. Calls to this function for
+    /// references that are currently not in the rendered scene should be ignored.
 
   private:
 
     void setAmbientMode();
+    
     SkyManager* mSkyManager;
+
     TerrainManager* mTerrainManager;
-    OEngine::Render::OgreRenderer &rend;
-    Ogre::Camera* camera;
-    MWRender::Npcs npcs;
-    MWRender::Creatures creatures;
-    MWRender::Objects objects;
+    OEngine::Render::OgreRenderer &mRendering;
+
+    MWRender::Objects mObjects;
+    MWRender::Actors mActors;
 
     // 0 normal, 1 more bright, 2 max
     int mAmbientMode;
 
     Ogre::ColourValue mAmbientColor;
+    Ogre::Light* mSun;
 
     /// Root node for all objects added to the scene. This is rotated so
     /// that the OGRE coordinate system matches that used internally in
     /// Morrowind.
-    Ogre::SceneNode *mwRoot;
+    Ogre::SceneNode *mMwRoot;
     Ogre::RaySceneQuery *mRaySceneQuery;
 
-    OEngine::Physic::PhysicEngine* eng;
+    OEngine::Physic::PhysicEngine* mPhysicsEngine;
 
     MWRender::Player *mPlayer;
     MWRender::Debugging mDebugging;
diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp
index 95601d043f..448050240b 100644
--- a/apps/openmw/mwrender/sky.cpp
+++ b/apps/openmw/mwrender/sky.cpp
@@ -1,116 +1,762 @@
 #include "sky.hpp"
-#include "Caelum.h"
 
-namespace MWRender
+#include <OgreCamera.h>
+#include <OgreRenderWindow.h>
+#include <OgreSceneNode.h>
+#include <OgreMesh.h>
+#include <OgreSceneManager.h>
+#include <OgreHardwareVertexBuffer.h>
+#include <OgreHighLevelGpuProgramManager.h>
+
+#include <components/nifogre/ogre_nif_loader.hpp>
+
+using namespace MWRender;
+using namespace Ogre;
+
+// the speed at which the clouds are animated
+#define CLOUD_SPEED 0.001
+
+// this distance has to be set accordingly so that the
+// celestial bodies are behind the clouds, but in front of the atmosphere
+#define CELESTIAL_BODY_DISTANCE 1000.f
+
+BillboardObject::BillboardObject( const String& textureName,
+                    const float initialSize,
+                    const Vector3& position,
+                    SceneNode* rootNode)
 {
-    //
-    // Implements a Caelum sky with default settings.
-    //
-    // Note: this is intended as a temporary solution to provide some form of 
-    // sky rendering.  This code will obviously need significant tailoring to
-    // support fidelity with Morrowind's rendering.  Before doing major work
-    // on this class, more research should be done to determine whether
-    // Caelum or another plug-in such as SkyX would be best for the long-term.
-    //
-    class CaelumManager : public SkyManager
+    init(textureName, initialSize, position, rootNode);
+}
+
+BillboardObject::BillboardObject()
+{
+}
+
+void BillboardObject::setVisible(const bool visible)
+{
+    mNode->setVisible(visible);
+}
+
+void BillboardObject::setSize(const float size)
+{
+    mNode->setScale(size, size, size);
+}
+
+void BillboardObject::setVisibility(const float visibility)
+{
+    mMaterial->getTechnique(0)->getPass(0)->setDiffuse(0.0, 0.0, 0.0, visibility);
+}
+
+void BillboardObject::setPosition(const Vector3& pPosition)
+{
+    Vector3 normalised = pPosition.normalisedCopy();
+    Vector3 finalPosition = normalised * CELESTIAL_BODY_DISTANCE;
+    
+    mBBSet->setCommonDirection( -normalised );
+
+    mNode->setPosition(finalPosition);
+}
+
+Vector3 BillboardObject::getPosition() const
+{
+    return mNode->getPosition();
+}
+
+void BillboardObject::setColour(const ColourValue& pColour)
+{
+    mMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(pColour);
+}
+
+void BillboardObject::setRenderQueue(unsigned int id)
+{
+    mBBSet->setRenderQueueGroup(id);
+}
+
+SceneNode* BillboardObject::getNode()
+{
+    return mNode;
+}
+
+void BillboardObject::init(const String& textureName,
+                    const float initialSize,
+                    const Vector3& position,
+                    SceneNode* rootNode)
+{
+    SceneManager* sceneMgr = rootNode->getCreator();
+        
+    Vector3 finalPosition = position.normalisedCopy() * CELESTIAL_BODY_DISTANCE;
+    
+    static unsigned int bodyCount=0;
+    
+    /// \todo These billboards are not 100% correct, might want to revisit them later
+    mBBSet = sceneMgr->createBillboardSet("SkyBillboardSet"+StringConverter::toString(bodyCount), 1);
+    mBBSet->setDefaultDimensions(550.f*initialSize, 550.f*initialSize);
+    mBBSet->setRenderQueueGroup(RENDER_QUEUE_SKIES_EARLY+2);
+    mBBSet->setBillboardType(BBT_PERPENDICULAR_COMMON);
+    mBBSet->setCommonDirection( -position.normalisedCopy() );
+    mNode = rootNode->createChildSceneNode();
+    mNode->setPosition(finalPosition);
+    mNode->attachObject(mBBSet);
+    mBBSet->createBillboard(0,0,0);
+    
+    mMaterial = MaterialManager::getSingleton().create("BillboardMaterial"+StringConverter::toString(bodyCount), ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+    mMaterial->removeAllTechniques();
+    Pass* p = mMaterial->createTechnique()->createPass();
+    p->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+    p->setDepthCheckEnabled(false);
+    p->setDepthWriteEnabled(false);
+    p->setSelfIllumination(1.0,1.0,1.0);
+    p->setDiffuse(0.0,0.0,0.0,1.0);
+    p->setAmbient(0.0,0.0,0.0);
+    p->createTextureUnitState(textureName);
+    mBBSet->setMaterialName("BillboardMaterial"+StringConverter::toString(bodyCount));
+    
+    bodyCount++;
+}
+
+Moon::Moon( const String& textureName,
+                    const float initialSize,
+                    const Vector3& position,
+                    SceneNode* rootNode)
+{
+    init(textureName, initialSize, position, rootNode);
+
+    HighLevelGpuProgramManager& mgr = HighLevelGpuProgramManager::getSingleton();
+    HighLevelGpuProgramPtr vshader;
+    if (mgr.resourceExists("Moon_VP"))
+        vshader = mgr.getByName("Moon_VP");
+    else
+        vshader = mgr.createProgram("Moon_VP", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, "cg", GPT_VERTEX_PROGRAM);
+    vshader->setParameter("profiles", "vs_2_x arbvp1");
+    vshader->setParameter("entry_point", "main_vp");
+    StringUtil::StrStreamType outStream;
+    outStream <<
+    "void main_vp(	\n"
+    "	float4 position : POSITION,	\n"
+    "   in float2 uv : TEXCOORD0, \n"
+    "   out float2 oUV : TEXCOORD0, \n"
+    "	out float4 oPosition : POSITION,	\n"
+    "	uniform float4x4 worldViewProj	\n"
+    ")	\n"
+    "{	\n"
+    "   oUV = uv; \n"
+    "	oPosition = mul( worldViewProj, position );  \n"
+    "}";
+    vshader->setSource(outStream.str());
+    vshader->load();
+    vshader->getDefaultParameters()->setNamedAutoConstant("worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+    mMaterial->getTechnique(0)->getPass(0)->setVertexProgram(vshader->getName());
+    
+    HighLevelGpuProgramPtr fshader;
+    if (mgr.resourceExists("Moon_FP"))
+        fshader = mgr.getByName("Moon_FP");
+    else
+        fshader = mgr.createProgram("Moon_FP", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, "cg", GPT_FRAGMENT_PROGRAM);
+
+    fshader->setParameter("profiles", "ps_2_x arbfp1");
+    fshader->setParameter("entry_point", "main_fp");
+    StringUtil::StrStreamType outStream2;
+    outStream2 <<
+    "void main_fp(	\n"
+    "   in float2 uv : TEXCOORD0, \n"
+    "	out float4 oColor    : COLOR, \n"
+    "   uniform sampler2D texture : TEXUNIT0, \n"
+    "   uniform float4 diffuse, \n"
+    "   uniform float4 emissive \n"
+    ")	\n"
+    "{	\n"
+    "   float4 tex = tex2D(texture, uv); \n"
+    "   oColor = float4(emissive.xyz,1) * tex2D(texture, uv) * float4(1,1,1,diffuse.a); \n"
+    "}";
+    fshader->setSource(outStream2.str());
+    fshader->load();
+    fshader->getDefaultParameters()->setNamedAutoConstant("diffuse", GpuProgramParameters::ACT_SURFACE_DIFFUSE_COLOUR);
+    fshader->getDefaultParameters()->setNamedAutoConstant("emissive", GpuProgramParameters::ACT_SURFACE_EMISSIVE_COLOUR);
+    mMaterial->getTechnique(0)->getPass(0)->setFragmentProgram(fshader->getName());
+    
+    setVisibility(1.0);
+    
+    mPhase = Moon::Phase_Full;
+}
+
+void Moon::setType(const Moon::Type& type)
+{
+    mType = type;
+}
+
+
+/// \todo the moon phase rendering is not correct - the dark part of the moon does not occlude the stars
+void Moon::setPhase(const Moon::Phase& phase)
+{
+    Ogre::String textureName = "textures\\tx_";
+    
+    if (mType == Moon::Type_Secunda) textureName += "secunda_";
+    else textureName += "masser_";
+    
+    if      (phase == Moon::Phase_New)              textureName += "new";
+    else if (phase == Moon::Phase_WaxingCrescent)   textureName += "one_wax";
+    else if (phase == Moon::Phase_WaxingHalf)       textureName += "half_wax";
+    else if (phase == Moon::Phase_WaxingGibbous)    textureName += "three_wax";
+    else if (phase == Moon::Phase_WaningCrescent)   textureName += "one_wan";
+    else if (phase == Moon::Phase_WaningHalf)       textureName += "half_wan";
+    else if (phase == Moon::Phase_WaningGibbous)    textureName += "three_wan";
+    else if (phase == Moon::Phase_Full)             textureName += "full";
+
+    textureName += ".dds";
+    
+    mMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(textureName);
+    
+    mPhase = phase;
+}
+
+Moon::Phase Moon::getPhase() const
+{
+    return mPhase;
+}
+
+unsigned int Moon::getPhaseInt() const
+{
+    if      (mPhase == Moon::Phase_New)              return 0;
+    else if (mPhase == Moon::Phase_WaxingCrescent)   return 1;
+    else if (mPhase == Moon::Phase_WaningCrescent)   return 1;
+    else if (mPhase == Moon::Phase_WaxingHalf)       return 2;
+    else if (mPhase == Moon::Phase_WaningHalf)       return 2;
+    else if (mPhase == Moon::Phase_WaxingGibbous)    return 3;
+    else if (mPhase == Moon::Phase_WaningGibbous)    return 3;
+    else if (mPhase == Moon::Phase_Full)             return 4;
+    
+    return 0;
+}
+
+void SkyManager::ModVertexAlpha(Entity* ent, unsigned int meshType)
+{    
+    // Get the vertex colour buffer of this mesh
+    const Ogre::VertexElement* ves_diffuse = ent->getMesh()->getSubMesh(0)->vertexData->vertexDeclaration->findElementBySemantic( Ogre::VES_DIFFUSE );
+    HardwareVertexBufferSharedPtr colourBuffer = ent->getMesh()->getSubMesh(0)->vertexData->vertexBufferBinding->getBuffer(ves_diffuse->getSource());
+    
+    // Lock
+    void* pData = colourBuffer->lock(HardwareBuffer::HBL_NORMAL);
+    
+    // Iterate over all vertices
+    int vertex_size = colourBuffer->getVertexSize();
+    float * currentVertex = NULL;
+    for (unsigned int i=0; i<colourBuffer->getNumVertices(); ++i)
     {
-    protected:
-        Caelum::CaelumSystem*   mpCaelumSystem;
+        // Get a pointer to the vertex colour
+        ves_diffuse->baseVertexPointerToElement( pData, &currentVertex );
+        
+        unsigned char alpha;
+        if (meshType == 0) alpha = i%2 ? 0 : 255; // this is a cylinder, so every second vertex belongs to the bottom-most row
+        else if (meshType == 1)
+        {
+            if (i>= 49 && i <= 64) alpha = 0; // bottom-most row
+            else if (i>= 33 && i <= 48) alpha = 64; // second bottom-most row
+            else alpha = 255;
+        }
+        
+        uint8 tmpR = static_cast<uint8>(255);
+        uint8 tmpG = static_cast<uint8>(255);
+        uint8 tmpB = static_cast<uint8>(255);
+        uint8 tmpA = static_cast<uint8>(alpha);
+        
+        // This does not matter since R and B are always 1.
+        /*VertexElementType format = Root::getSingleton().getRenderSystem()->getColourVertexElementType();
+        switch (format)
+        {
+        case VET_COLOUR_ARGB:
+            std::swap(tmpR, tmpB);
+            break;
+        case VET_COLOUR_ABGR:
+            break;
+        default:
+            break;
+        }*/
+         
+        // Modify
+        *((uint32*)currentVertex) = tmpR | (tmpG << 8) | (tmpB << 16) | (tmpA << 24);
+        
+        // Move to the next vertex
+        pData+=vertex_size;
+    }
+    
+    // Unlock
+    ent->getMesh()->getSubMesh(0)->vertexData->vertexBufferBinding->getBuffer(ves_diffuse->getSource())->unlock();
+}
 
-    public:
-                 CaelumManager (Ogre::RenderWindow* pRenderWindow, 
-                                   Ogre::Camera* pCamera,
-                                   const boost::filesystem::path& resDir);
-        virtual ~CaelumManager ();
-        
-        virtual void enable() {}
-        
-        virtual void disable() {}
-        
-        virtual void setHour (double hour) {}
-        ///< will be called even when sky is disabled.
-        
-        virtual void setDate (int day, int month) {}
-        ///< will be called even when sky is disabled.
-        
-        virtual int getMasserPhase() const { return 0; }
-        ///< 0 new moon, 1 waxing or waning cresecent, 2 waxing or waning half,
-        /// 3 waxing or waning gibbous, 4 full moon
-        
-        virtual int getSecundaPhase() const { return 0; }
-        ///< 0 new moon, 1 waxing or waning cresecent, 2 waxing or waning half,
-        /// 3 waxing or waning gibbous, 4 full moon
-        
-        virtual void setMoonColour (bool red) {}
-    };
+SkyManager::SkyManager (SceneNode* pMwRoot, Camera* pCamera) :
+    mGlareFade(0), mGlareEnabled(false)
+{
+    mViewport = pCamera->getViewport();
+    mSceneMgr = pMwRoot->getCreator();
+    mRootNode = pCamera->getParentSceneNode()->createChildSceneNode();
+    mRootNode->pitch(Degree(-90)); // convert MW to ogre coordinates
+    mRootNode->setInheritOrientation(false);
+    
+    /// \todo preload all the textures and meshes that are used for sky rendering
+    
+    // Create overlay used for thunderstorm
+    MaterialPtr material = MaterialManager::getSingleton().create( "ThunderMaterial", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME );
+    Pass* pass = material->getTechnique(0)->getPass(0);
+    pass->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+    mThunderTextureUnit = pass->createTextureUnitState();
+    mThunderTextureUnit->setColourOperationEx(LBX_SOURCE1, LBS_MANUAL, LBS_CURRENT, ColourValue(1.f, 1.f, 1.f)); // always black colour    
+    mThunderTextureUnit->setAlphaOperation(LBX_SOURCE1, LBS_MANUAL, LBS_CURRENT, 0.5f);
+    OverlayManager& ovm = OverlayManager::getSingleton();
+    mThunderOverlay = ovm.create( "ThunderOverlay" );
+    OverlayContainer* overlay_panel;
+    overlay_panel = (OverlayContainer*)ovm.createOverlayElement("Panel", "ThunderPanel");
+    overlay_panel->_setPosition(0, 0);
+    overlay_panel->_setDimensions(1, 1);
+    overlay_panel->setMaterialName( "ThunderMaterial" );
+    overlay_panel->show();
+    mThunderOverlay->add2D(overlay_panel);
+    mThunderOverlay->hide();
+    
+    mSecunda = new Moon("textures\\tx_secunda_full.dds", 0.5, Vector3(-0.4, 0.4, 0.5), mRootNode);
+    mSecunda->setType(Moon::Type_Secunda);
+    mSecunda->setRenderQueue(RENDER_QUEUE_SKIES_EARLY+4);
+    
+    mMasser = new Moon("textures\\tx_masser_full.dds", 0.75, Vector3(-0.4, 0.4, 0.5), mRootNode);
+    mMasser->setRenderQueue(RENDER_QUEUE_SKIES_EARLY+3);
+    mMasser->setType(Moon::Type_Masser);
+    
+    mSun = new BillboardObject("textures\\tx_sun_05.dds", 1, Vector3(0.4, 0.4, 0.4), mRootNode);
+    mSunGlare = new BillboardObject("textures\\tx_sun_flash_grey_05.dds", 3, Vector3(0.4, 0.4, 0.4), mRootNode);
+    mSunGlare->setRenderQueue(RENDER_QUEUE_SKIES_LATE);
 
-    CaelumManager::CaelumManager (Ogre::RenderWindow* pRenderWindow, 
-                                  Ogre::Camera* pCamera,
-                                  const boost::filesystem::path& resDir)
-        : mpCaelumSystem        (NULL)
+                
+    HighLevelGpuProgramManager& mgr = HighLevelGpuProgramManager::getSingleton();
+
+    // Stars
+    /// \todo sky_night_02.nif (available in Bloodmoon)
+    MeshPtr mesh = NifOgre::NIFLoader::load("meshes\\sky_night_01.nif");        
+    Entity* night1_ent = mSceneMgr->createEntity("meshes\\sky_night_01.nif");
+    night1_ent->setRenderQueueGroup(RENDER_QUEUE_SKIES_EARLY+1);
+        
+    mAtmosphereNight = mRootNode->createChildSceneNode();
+    mAtmosphereNight->attachObject(night1_ent);
+    
+    for (unsigned int i=0; i<night1_ent->getNumSubEntities(); ++i)
     {
-        using namespace Ogre;
-        using namespace Caelum;
-
-        assert(pCamera);
-        assert(pRenderWindow);
-
-        // Load the Caelum resources
-        //
-        ResourceGroupManager::getSingleton().addResourceLocation((resDir / "caelum").string(), "FileSystem", "Caelum");
-        ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
-
-        // Load the Caelum resources
-        //
-        Ogre::SceneManager* pScene = pCamera->getSceneManager();
-        Caelum::CaelumSystem::CaelumComponent componentMask = CaelumSystem::CAELUM_COMPONENTS_DEFAULT;
-        mpCaelumSystem = new Caelum::CaelumSystem (Root::getSingletonPtr(), pScene, componentMask);
+        MaterialPtr mp = night1_ent->getSubEntity(i)->getMaterial();
+        mp->getTechnique(0)->getPass(0)->setSelfIllumination(1.0, 1.0, 1.0);
+        mp->getTechnique(0)->getPass(0)->setAmbient(0.0, 0.0, 0.0);
+        mp->getTechnique(0)->getPass(0)->setDiffuse(0.0, 0.0, 0.0, 1.0);
+        mp->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
+        mp->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
+        mp->getTechnique(0)->getPass(0)->setSceneBlending(SBT_TRANSPARENT_ALPHA);
         
-        // Set time acceleration.
-        mpCaelumSystem->getUniversalClock()->setTimeScale(128);       
+        mStarsMaterials[i] = mp;
+    }
+    
+    // Stars vertex shader
+    HighLevelGpuProgramPtr vshader3 = mgr.createProgram("Stars_VP", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+        "cg", GPT_VERTEX_PROGRAM);
+    vshader3->setParameter("profiles", "vs_2_x arbvp1");
+    vshader3->setParameter("entry_point", "main_vp");
+    StringUtil::StrStreamType outStream4;
+    outStream4 <<
+    "void main_vp(	\n"
+    "	float4 position : POSITION,	\n"
+    "   in float2 uv : TEXCOORD0, \n"
+    "   out float2 oUV : TEXCOORD0, \n"
+    "   out float oFade : TEXCOORD1, \n"
+    "	out float4 oPosition : POSITION,	\n"
+    "	uniform float4x4 worldViewProj	\n"
+    ")	\n"
+    "{	\n"
+    "   oUV = uv; \n"
+    "   oFade = (position.z > 50) ? 1.f : 0.f; \n"
+    "	oPosition = mul( worldViewProj, position );  \n"
+    "}";
+    vshader3->setSource(outStream4.str());
+    vshader3->load();
+    vshader3->getDefaultParameters()->setNamedAutoConstant("worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+    night1_ent->getSubEntity(3)->getMaterial()->getTechnique(0)->getPass(0)->setVertexProgram(vshader3->getName());
+    
+    // Stars fragment shader
+    HighLevelGpuProgramPtr stars_fp = mgr.createProgram("Stars_FP", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+        "cg", GPT_FRAGMENT_PROGRAM);
+    stars_fp->setParameter("profiles", "ps_2_x arbfp1");
+    stars_fp->setParameter("entry_point", "main_fp");
+    StringUtil::StrStreamType outStream5;
+    outStream5 <<
+    "void main_fp(	\n"
+    "   in float2 uv : TEXCOORD0, \n"
+    "	out float4 oColor    : COLOR, \n"
+    "   in float fade : TEXCOORD1, \n"
+    "   uniform sampler2D texture : TEXUNIT0, \n"
+    "   uniform float opacity, \n"
+    "   uniform float4 diffuse, \n"
+    "   uniform float4 emissive \n"
+    ")	\n"
+    "{	\n"
+    "   oColor =  tex2D(texture, uv) * float4(emissive.xyz, 1) * float4(1,1,1,fade*diffuse.a); \n"
+    "}";
+    stars_fp->setSource(outStream5.str());
+    stars_fp->load();
+    stars_fp->getDefaultParameters()->setNamedAutoConstant("emissive", GpuProgramParameters::ACT_SURFACE_EMISSIVE_COLOUR);
+    stars_fp->getDefaultParameters()->setNamedAutoConstant("diffuse", GpuProgramParameters::ACT_SURFACE_DIFFUSE_COLOUR);
+    night1_ent->getSubEntity(3)->getMaterial()->getTechnique(0)->getPass(0)->setFragmentProgram(stars_fp->getName());
+    
+    // Atmosphere (day)
+    mesh = NifOgre::NIFLoader::load("meshes\\sky_atmosphere.nif");        
+    Entity* atmosphere_ent = mSceneMgr->createEntity("meshes\\sky_atmosphere.nif");
+    
+    ModVertexAlpha(atmosphere_ent, 0);
+    
+    atmosphere_ent->setRenderQueueGroup(RENDER_QUEUE_SKIES_EARLY);
+    mAtmosphereDay = mRootNode->createChildSceneNode();
+    mAtmosphereDay->attachObject(atmosphere_ent);
+    mAtmosphereMaterial = atmosphere_ent->getSubEntity(0)->getMaterial();
+    
+    // Atmosphere shader
+    HighLevelGpuProgramPtr vshader = mgr.createProgram("Atmosphere_VP", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+        "cg", GPT_VERTEX_PROGRAM);
 
-        // Disable fog since OpenMW is handling OGRE fog elsewhere
-        mpCaelumSystem->setManageSceneFog(false);
+    vshader->setParameter("profiles", "vs_2_x arbvp1");
+    vshader->setParameter("entry_point", "main_vp");
+    
+    StringUtil::StrStreamType outStream;
+    outStream <<
+    "void main_vp(	\n"
+    "	float4 position : POSITION,	\n"
+    "	in float4 color	: COLOR,	\n"
+    "	out float4 oPosition : POSITION,	\n"
+    "	out float4 oColor    : COLOR, \n"
+    "   uniform float4 emissive, \n"
+    "	uniform float4x4 worldViewProj	\n"
+    ")	\n"
+    "{	\n"
+    "	oPosition = mul( worldViewProj, position );  \n"
+    "   oColor = color * emissive; \n"
+    "}";
+    vshader->setSource(outStream.str());
+    vshader->load();
+    
+    vshader->getDefaultParameters()->setNamedAutoConstant("worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+    vshader->getDefaultParameters()->setNamedAutoConstant("emissive", GpuProgramParameters::ACT_SURFACE_EMISSIVE_COLOUR);
+    mAtmosphereMaterial->getTechnique(0)->getPass(0)->setVertexProgram(vshader->getName());
 
-        // Change the camera far distance to make sure the sky is not clipped
-        pCamera->setFarClipDistance(50000);
+    // Clouds
+    NifOgre::NIFLoader::load("meshes\\sky_clouds_01.nif");
+    Entity* clouds_ent = mSceneMgr->createEntity("meshes\\sky_clouds_01.nif");
+    clouds_ent->setRenderQueueGroup(RENDER_QUEUE_SKIES_EARLY+5);
+    SceneNode* clouds_node = mRootNode->createChildSceneNode();
+    clouds_node->attachObject(clouds_ent);
+    mCloudMaterial = clouds_ent->getSubEntity(0)->getMaterial();
+    
+    // Clouds vertex shader
+    HighLevelGpuProgramPtr vshader2 = mgr.createProgram("Clouds_VP", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+        "cg", GPT_VERTEX_PROGRAM);
+    vshader2->setParameter("profiles", "vs_2_x arbvp1");
+    vshader2->setParameter("entry_point", "main_vp");
+    StringUtil::StrStreamType outStream3;
+    outStream3 <<
+    "void main_vp(	\n"
+    "	float4 position : POSITION,	\n"
+    "	in float4 color	: COLOR,	\n"
+    "   out float4 oColor : TEXCOORD1, \n"
+    "   in float2 uv : TEXCOORD0, \n"
+    "   out float2 oUV : TEXCOORD0, \n"
+    "	out float4 oPosition : POSITION,	\n"
+    "	uniform float4x4 worldViewProj	\n"
+    ")	\n"
+    "{	\n"
+    "   oUV = uv; \n"
+    "   oColor = color; \n"
+    "	oPosition = mul( worldViewProj, position );  \n"
+    "}";
+    vshader2->setSource(outStream3.str());
+    vshader2->load();
+    vshader2->getDefaultParameters()->setNamedAutoConstant("worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
+    mCloudMaterial->getTechnique(0)->getPass(0)->setVertexProgram(vshader2->getName());
+    
+    // Clouds fragment shader
+    mCloudFragmentShader = mgr.createProgram("Clouds_FP", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
+        "cg", GPT_FRAGMENT_PROGRAM);
+    mCloudFragmentShader->setParameter("profiles", "ps_2_x arbfp1");
+    mCloudFragmentShader->setParameter("entry_point", "main_fp");
+    StringUtil::StrStreamType outStream2;
+    outStream2 <<
+    "void main_fp(	\n"
+    "   in float2 uv : TEXCOORD0, \n"
+    "	out float4 oColor    : COLOR, \n"
+    "   in float4 color : TEXCOORD1, \n"
+    "   uniform sampler2D texture : TEXUNIT0, \n"
+    "   uniform sampler2D secondTexture : TEXUNIT1, \n"
+    "   uniform float transitionFactor, \n"
+    "   uniform float time, \n"
+    "   uniform float speed, \n"
+    "   uniform float opacity, \n"
+    "   uniform float4 emissive \n"
+    ")	\n"
+    "{	\n"
+    "   uv += float2(1,1) * time * speed * "<<CLOUD_SPEED<<"; \n" // Scroll in x,y direction
+    "   float4 tex = lerp(tex2D(texture, uv), tex2D(secondTexture, uv), transitionFactor); \n"
+    "   oColor = color * float4(emissive.xyz,1) * tex * float4(1,1,1,opacity); \n"
+    "}";
+    mCloudFragmentShader->setSource(outStream2.str());
+    mCloudFragmentShader->load();
+    mCloudFragmentShader->getDefaultParameters()->setNamedAutoConstant("emissive", GpuProgramParameters::ACT_SURFACE_EMISSIVE_COLOUR);
+    mCloudMaterial->getTechnique(0)->getPass(0)->setFragmentProgram(mCloudFragmentShader->getName());
+    setCloudsOpacity(0.75);
+    
+    ModVertexAlpha(clouds_ent, 1);
+    
+    // I'm not sure if the materials are being used by any other objects
+    // Make a unique "modifiable" copy of the materials to be sure
+    mCloudMaterial = mCloudMaterial->clone("Clouds");
+    clouds_ent->getSubEntity(0)->setMaterial(mCloudMaterial);
+    mAtmosphereMaterial = mAtmosphereMaterial->clone("Atmosphere");
+    atmosphere_ent->getSubEntity(0)->setMaterial(mAtmosphereMaterial);
+    
+    mAtmosphereMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(1.0, 1.0, 1.0);
+    mAtmosphereMaterial->getTechnique(0)->getPass(0)->setDiffuse(0.0, 0.0, 0.0, 0.0);
+    mAtmosphereMaterial->getTechnique(0)->getPass(0)->setAmbient(0.0, 0.0, 0.0);
+    mCloudMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(1.0, 1.0, 1.0);
+    mCloudMaterial->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
+    mAtmosphereMaterial->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
+    mAtmosphereMaterial->getTechnique(0)->getPass(0)->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+    mCloudMaterial->getTechnique(0)->getPass(0)->setSceneBlending(SBT_TRANSPARENT_ALPHA);
+    
+    mCloudMaterial->getTechnique(0)->getPass(0)->createTextureUnitState("");
+}
 
-        // Register Caelum as an OGRE listener
-        pRenderWindow->addListener(mpCaelumSystem);
-        Root::getSingletonPtr()->addFrameListener(mpCaelumSystem);
+SkyManager::~SkyManager()
+{
+    delete mSun;
+    delete mSunGlare;
+    delete mMasser;
+    delete mSecunda;
+}
+
+int SkyManager::getMasserPhase() const
+{
+    return mMasser->getPhaseInt();
+}
+
+int SkyManager::getSecundaPhase() const
+{
+    return mSecunda->getPhaseInt();
+}
+
+void SkyManager::update(float duration)
+{
+    if (!mEnabled) return;
+    
+    // UV Scroll the clouds
+    mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstantFromTime("time", 1);
+    
+    /// \todo improve this
+    mMasser->setPhase( static_cast<Moon::Phase>( (int) ((mDay % 32)/4.f)) );
+    mSecunda->setPhase ( static_cast<Moon::Phase>( (int) ((mDay % 32)/4.f)) );
+    
+    // increase the strength of the sun glare effect depending 
+    // on how directly the player is looking at the sun
+    if (mSunEnabled)
+    {
+        Vector3 sun = mSunGlare->getPosition();
+        sun = Vector3(sun.x, sun.z, -sun.y);
+        Vector3 cam = mViewport->getCamera()->getRealDirection();
+        const Degree angle = sun.angleBetween( cam );
+        float val = 1- (angle.valueDegrees() / 180.f);
+        val = (val*val*val*val)*2;
+        
+        if (mGlareEnabled)
+        {
+            mGlareFade += duration*3;
+            if (mGlareFade > 1) mGlareFade = 1;
+        }
+        else
+        {
+            mGlareFade -= duration*3;
+            if (mGlareFade < 0.3) mGlareFade = 0;
+        }
+        
+        mSunGlare->setSize(val * (mGlareFade));
+    }
+    
+    mSunGlare->setVisible(mGlareFade>0 && mSunEnabled);
+    mSun->setVisible(mSunEnabled);
+    mMasser->setVisible(mMasserEnabled);
+    mSecunda->setVisible(mSecundaEnabled);
+}
+
+void SkyManager::enable()
+{
+    mRootNode->setVisible(true);
+    mEnabled = true;
+}
+
+void SkyManager::disable()
+{
+    mRootNode->setVisible(false);
+    mEnabled = false;
+}
+
+void SkyManager::setMoonColour (bool red)
+{
+    mSecunda->setColour( red ? ColourValue(1.0, 0.0784, 0.0784)
+                            : ColourValue(1.0, 1.0, 1.0));
+}
+
+void SkyManager::setCloudsOpacity(float opacity)
+{
+    mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("opacity", Real(opacity));
+}
+
+void SkyManager::setWeather(const MWWorld::WeatherResult& weather)
+{
+    if (mClouds != weather.mCloudTexture)
+    {
+        mCloudMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName("textures\\"+weather.mCloudTexture);
+        mClouds = weather.mCloudTexture;
+    }
+    
+    if (mNextClouds != weather.mNextCloudTexture)
+    {
+        mCloudMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName("textures\\"+weather.mNextCloudTexture);
+        mNextClouds = weather.mNextCloudTexture;
+    }
+    
+    if (mCloudBlendFactor != weather.mCloudBlendFactor)
+    {
+        mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("transitionFactor", Real(weather.mCloudBlendFactor));
+        mCloudBlendFactor = weather.mCloudBlendFactor;
+    }
+    
+    if (mCloudOpacity != weather.mCloudOpacity)
+    {
+        mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("opacity", Real(weather.mCloudOpacity));
+        mCloudOpacity = weather.mCloudOpacity;
+    }
+    
+    if (mCloudColour != weather.mSunColor)
+    {
+        ColourValue clr( weather.mSunColor.r*0.7 + weather.mAmbientColor.r*0.7,
+                        weather.mSunColor.g*0.7 + weather.mAmbientColor.g*0.7,
+                        weather.mSunColor.b*0.7 + weather.mAmbientColor.b*0.7);
+        
+        mCloudMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(clr);
+        mCloudColour = weather.mSunColor;
+    }
+    
+    if (mSkyColour != weather.mSkyColor)
+    { 
+        mAtmosphereMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(weather.mSkyColor);
+        mSkyColour = weather.mSkyColor;
+    }
+    
+    if (mCloudSpeed != weather.mCloudSpeed)
+    {
+        mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("speed", Real(weather.mCloudSpeed));
+        mCloudSpeed = weather.mCloudSpeed;
+    }
+    
+    if (weather.mNight && mStarsOpacity != weather.mNightFade)
+    {
+        for (int i=0; i<7; ++i)
+            mStarsMaterials[i]->getTechnique(0)->getPass(0)->setDiffuse(0.0, 0.0, 0.0, weather.mNightFade);
+        mStarsOpacity = weather.mNightFade;
     }
 
-    CaelumManager::~CaelumManager() 
+    float strength;
+    float timeofday_angle = std::abs(mSunGlare->getPosition().z/mSunGlare->getPosition().length());
+    if (timeofday_angle <= 0.44)
+        strength = timeofday_angle/0.44f;
+    else
+        strength = 1.f;
+    
+    mSunGlare->setVisibility(weather.mGlareView * strength);
+    
+    mAtmosphereNight->setVisible(weather.mNight && mEnabled);
+}
+
+void SkyManager::setGlare(bool glare)
+{
+    mGlareEnabled = glare;
+}
+
+Vector3 SkyManager::getRealSunPos()
+{
+    return mSun->getNode()->_getDerivedPosition();
+}
+
+void SkyManager::sunEnable()
+{
+    mSunEnabled = true;
+}
+
+void SkyManager::sunDisable()
+{
+    mSunEnabled = false;
+}
+
+void SkyManager::setSunDirection(const Vector3& direction)
+{
+    mSun->setPosition(direction);
+    mSunGlare->setPosition(direction);
+}
+
+void SkyManager::setMasserDirection(const Vector3& direction)
+{
+    mMasser->setPosition(direction);
+}
+
+void SkyManager::setSecundaDirection(const Vector3& direction)
+{
+    mSecunda->setPosition(direction);
+}
+
+void SkyManager::masserEnable()
+{
+    mMasserEnabled = true;
+}
+
+void SkyManager::secundaEnable()
+{
+    mSecundaEnabled = true;
+}
+
+void SkyManager::masserDisable()
+{
+    mMasserEnabled = false;
+}
+
+void SkyManager::secundaDisable()
+{
+    mSecundaEnabled = false;
+}
+
+void SkyManager::setThunder(const float factor)
+{
+    if (factor > 0.f)
     {
-        if (mpCaelumSystem) 
-            mpCaelumSystem->shutdown (false);
+        mThunderOverlay->show();
+        mThunderTextureUnit->setAlphaOperation(LBX_SOURCE1, LBS_MANUAL, LBS_CURRENT, factor*0.6);
     }
+    else
+        mThunderOverlay->hide();
+}
 
-    /// Creates and connects the sky rendering component to OGRE.
-    ///
-    /// \return NULL on failure.
-    /// 
-    SkyManager* SkyManager::create (Ogre::RenderWindow* pRenderWindow, 
-                                    Ogre::Camera*       pCamera,
-                                    const boost::filesystem::path& resDir)
-    {
-        SkyManager* pSkyManager = NULL;
+void SkyManager::setMasserFade(const float fade)
+{
+    mMasser->setVisibility(fade);
+}
 
-        try
-        {
-            pSkyManager = new CaelumManager(pRenderWindow, pCamera, resDir);
-        }
-        catch (Ogre::Exception& e)
-        {
-            std::cout << "\nOGRE Exception when attempting to add sky: " 
-                << e.getFullDescription().c_str() << std::endl;
-        }
-        catch (std::exception& e)
-        {
-            std::cout << "\nException when attempting to add sky: " 
-                << e.what() << std::endl;
-        }
+void SkyManager::setSecundaFade(const float fade)
+{
+    mSecunda->setVisibility(fade);
+}
 
-        return pSkyManager;
-    }
-} 
+void SkyManager::setHour(double hour)
+{
+    mHour = hour;
+}
+
+void SkyManager::setDate(int day, int month)
+{
+    mDay = day;
+    mMonth = month;
+}
diff --git a/apps/openmw/mwrender/sky.hpp b/apps/openmw/mwrender/sky.hpp
index 446ed3f1c7..2678165e39 100644
--- a/apps/openmw/mwrender/sky.hpp
+++ b/apps/openmw/mwrender/sky.hpp
@@ -1,40 +1,211 @@
 #ifndef _GAME_RENDER_SKY_H
 #define _GAME_RENDER_SKY_H
 
-#include <boost/filesystem.hpp>
+#include <OgreVector3.h>
+#include <OgreString.h>
+#include <OgreMaterial.h>
+#include <OgreColourValue.h>
+#include <OgreHighLevelGpuProgram.h>
+
+#include "sky.hpp"
+#include "../mwworld/weather.hpp"
 
 namespace Ogre
 {
     class RenderWindow;
+    class SceneNode;
     class Camera;
+    class Viewport;
+    class SceneManager;
+    class Entity;
+    class BillboardSet;
+    class TextureUnitState;
+    class Overlay;
 }
 
 namespace MWRender
 {
-    ///
-    /// Interface for the sky rendering system
-    ///
+    class BillboardObject
+    {
+    public:
+        BillboardObject(  const Ogre::String& textureName,
+                        const float size,
+                        const Ogre::Vector3& position,
+                        Ogre::SceneNode* rootNode
+                    );
+        BillboardObject();
+        
+        void setColour(const Ogre::ColourValue& pColour);
+        void setPosition(const Ogre::Vector3& pPosition);
+        void setVisible(const bool visible);
+        void setRenderQueue(unsigned int id);
+        void setSize(const float size);
+        Ogre::Vector3 getPosition() const;
+        
+        void setVisibility(const float visibility);
+        
+        Ogre::SceneNode* getNode();
+        
+    protected:
+        virtual void init(const Ogre::String& textureName,
+                        const float size,
+                        const Ogre::Vector3& position,
+                        Ogre::SceneNode* rootNode);
+    
+        Ogre::SceneNode* mNode;
+        Ogre::MaterialPtr mMaterial;
+        Ogre::BillboardSet* mBBSet;
+    };
+    
+    
+    /*
+     * The moons need a seperate class because of their shader (which allows them to be partially transparent)
+     */
+    class Moon : public BillboardObject
+    {
+    public:
+        Moon(  const Ogre::String& textureName,
+                        const float size,
+                        const Ogre::Vector3& position,
+                        Ogre::SceneNode* rootNode
+                    );
+                        
+        enum Phase
+        {
+            Phase_New = 0,
+            Phase_WaxingCrescent,
+            Phase_WaxingHalf,
+            Phase_WaxingGibbous,
+            Phase_Full,
+            Phase_WaningGibbous,
+            Phase_WaningHalf,
+            Phase_WaningCrescent
+        };
+        
+        enum Type
+        {
+            Type_Masser = 0,
+            Type_Secunda
+        };
+        
+        void setPhase(const Phase& phase);
+        void setType(const Type& type);
+        
+        Phase getPhase() const;
+        unsigned int getPhaseInt() const;
+    
+    private:
+        Type mType;
+        Phase mPhase;
+    };
+        
     class SkyManager
     {
     public:
-        static SkyManager* create (Ogre::RenderWindow* pRenderWindow, 
-                                   Ogre::Camera* pCamera,
-                                   const boost::filesystem::path& resDir);
-        virtual ~SkyManager() {}
+        SkyManager(Ogre::SceneNode* pMwRoot, Ogre::Camera* pCamera);
+        ~SkyManager();
         
-        virtual void enable() = 0;
+        void update(float duration);
         
-        virtual void disable() = 0;
+        void enable();
         
-        virtual void setHour (double hour) = 0;
+        void disable();
         
-        virtual void setDate (int day, int month) = 0;
+        void setHour (double hour);
+        ///< will be called even when sky is disabled.
         
-        virtual int getMasserPhase() const = 0;
+        void setDate (int day, int month);
+        ///< will be called even when sky is disabled.
         
-        virtual int getSecundaPhase() const = 0;
+        int getMasserPhase() const;
+        ///< 0 new moon, 1 waxing or waning cresecent, 2 waxing or waning half,
+        /// 3 waxing or waning gibbous, 4 full moon
         
-        virtual void setMoonColour (bool red) = 0;
+        int getSecundaPhase() const;
+        ///< 0 new moon, 1 waxing or waning cresecent, 2 waxing or waning half,
+        /// 3 waxing or waning gibbous, 4 full moon
+        
+        void setMoonColour (bool red);
+        ///< change Secunda colour to red
+        
+        void setCloudsOpacity(float opacity);
+        ///< change opacity of the clouds
+        
+        void setWeather(const MWWorld::WeatherResult& weather);
+        
+        void sunEnable();
+        
+        void sunDisable();
+        
+        void setSunDirection(const Ogre::Vector3& direction);
+        
+        void setMasserDirection(const Ogre::Vector3& direction);
+        
+        void setSecundaDirection(const Ogre::Vector3& direction);
+        
+        void setMasserFade(const float fade);
+        
+        void setSecundaFade(const float fade);
+        
+        void masserEnable();
+        void masserDisable();
+
+        void secundaEnable();
+        void secundaDisable();
+        
+        void setThunder(const float factor);
+        
+        void setGlare(bool glare);
+        Ogre::Vector3 getRealSunPos();
+        
+    private:
+        float mHour;
+        int mDay;
+        int mMonth;
+    
+        BillboardObject* mSun;
+        BillboardObject* mSunGlare;
+        Moon* mMasser;
+        Moon* mSecunda;
+    
+        Ogre::Viewport* mViewport;
+        Ogre::SceneNode* mRootNode;
+        Ogre::SceneManager* mSceneMgr;
+        
+        Ogre::SceneNode* mAtmosphereDay;
+        Ogre::SceneNode* mAtmosphereNight;
+        
+        Ogre::MaterialPtr mCloudMaterial;
+        Ogre::MaterialPtr mAtmosphereMaterial;
+        
+        Ogre::MaterialPtr mStarsMaterials[7];
+        
+        Ogre::HighLevelGpuProgramPtr mCloudFragmentShader;
+        
+        // remember some settings so we don't have to apply them again if they didnt change
+        Ogre::String mClouds;
+        Ogre::String mNextClouds;
+        float mCloudBlendFactor;
+        float mCloudOpacity;
+        float mCloudSpeed;
+        float mStarsOpacity;
+        Ogre::ColourValue mCloudColour;
+        Ogre::ColourValue mSkyColour;
+        
+        Ogre::Overlay* mThunderOverlay;
+        Ogre::TextureUnitState* mThunderTextureUnit;
+                
+        float mRemainingTransitionTime;
+        
+        float mGlareFade;
+        
+        void ModVertexAlpha(Ogre::Entity* ent, unsigned int meshType);
+        
+        bool mEnabled;
+        bool mGlareEnabled;
+        bool mSunEnabled;
+        bool mMasserEnabled;
+        bool mSecundaEnabled;
     };
 }
 
diff --git a/apps/openmw/mwrender/terrainmaterial.cpp b/apps/openmw/mwrender/terrainmaterial.cpp
index 541fcb91eb..bbb6a66065 100644
--- a/apps/openmw/mwrender/terrainmaterial.cpp
+++ b/apps/openmw/mwrender/terrainmaterial.cpp
@@ -1020,8 +1020,10 @@ namespace Ogre
 		{
 			outStream << 
 				// global normal
-				"	float3 normal = expand(tex2D(globalNormal, uv)).rgb;\n"
-                                "       normal = float3(normal.x, normal.z, -normal.y); \n"; // convert Ogre to MW coordinate system
+				"	float3 normal = expand(tex2D(globalNormal, uv)).rgb;\n";
+                                
+                                // not needed anymore apparently
+                                //"       normal = float3(normal.x, normal.z, -normal.y); \n"; // convert Ogre to MW coordinate system
 
 		}
 
diff --git a/apps/openmw/mwscript/aiextensions.cpp b/apps/openmw/mwscript/aiextensions.cpp
index 6d74ae45a2..aa541e55d3 100644
--- a/apps/openmw/mwscript/aiextensions.cpp
+++ b/apps/openmw/mwscript/aiextensions.cpp
@@ -25,13 +25,13 @@ namespace MWScript
                 {
                     MWWorld::Ptr ptr = R()(runtime);
 
-                    Interpreter::Type_Float x = runtime[0].mInteger;
+                    Interpreter::Type_Float x = runtime[0].mFloat;
                     runtime.pop();
 
-                    Interpreter::Type_Float y = runtime[0].mInteger;
+                    Interpreter::Type_Float y = runtime[0].mFloat;
                     runtime.pop();
 
-                    Interpreter::Type_Float z = runtime[0].mInteger;
+                    Interpreter::Type_Float z = runtime[0].mFloat;
                     runtime.pop();
 
                     // discard additional arguments (reset), because we have no idea what they mean.
@@ -53,16 +53,16 @@ namespace MWScript
                     std::string actor = runtime.getStringLiteral (runtime[0].mInteger);
                     runtime.pop();
 
-                    Interpreter::Type_Float duration = runtime[0].mInteger;
+                    Interpreter::Type_Float duration = runtime[0].mFloat;
                     runtime.pop();
 
-                    Interpreter::Type_Float x = runtime[0].mInteger;
+                    Interpreter::Type_Float x = runtime[0].mFloat;
                     runtime.pop();
 
-                    Interpreter::Type_Float y = runtime[0].mInteger;
+                    Interpreter::Type_Float y = runtime[0].mFloat;
                     runtime.pop();
 
-                    Interpreter::Type_Float z = runtime[0].mInteger;
+                    Interpreter::Type_Float z = runtime[0].mFloat;
                     runtime.pop();
 
                     // discard additional arguments (reset), because we have no idea what they mean.
@@ -99,9 +99,9 @@ namespace MWScript
 
         void registerExtensions (Compiler::Extensions& extensions)
         {
-            extensions.registerInstruction ("aitravel", "lll/l", opcodeAiTravel,
+            extensions.registerInstruction ("aitravel", "fff/l", opcodeAiTravel,
                 opcodeAiTravelExplicit);
-            extensions.registerInstruction ("aiescort", "cllll/l", opcodeAiEscort,
+            extensions.registerInstruction ("aiescort", "cffff/l", opcodeAiEscort,
                 opcodeAiEscortExplicit);
 
             extensions.registerFunction ("getaipackagedone", 'l', "", opcodeGetAiPackageDone,
diff --git a/apps/openmw/mwscript/animationextensions.cpp b/apps/openmw/mwscript/animationextensions.cpp
new file mode 100644
index 0000000000..184be83db4
--- /dev/null
+++ b/apps/openmw/mwscript/animationextensions.cpp
@@ -0,0 +1,127 @@
+
+#include "animationextensions.hpp"
+
+#include <stdexcept>
+
+#include <components/compiler/extensions.hpp>
+
+#include <components/interpreter/interpreter.hpp>
+#include <components/interpreter/runtime.hpp>
+#include <components/interpreter/opcodes.hpp>
+
+#include "../mwworld/world.hpp"
+
+#include "interpretercontext.hpp"
+#include "ref.hpp"
+
+namespace MWScript
+{
+    namespace Animation
+    {
+        template<class R>
+        class OpSkipAnim : public Interpreter::Opcode0
+        {
+            public:
+
+                virtual void execute (Interpreter::Runtime& runtime)
+                {
+                    MWWorld::Ptr ptr = R()(runtime);
+
+                    InterpreterContext& context =
+                        static_cast<InterpreterContext&> (runtime.getContext());
+
+                    context.getWorld().skipAnimation (ptr);
+               }
+        };
+
+        template<class R>
+        class OpPlayAnim : public Interpreter::Opcode1
+        {
+            public:
+
+                virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
+                {
+                    MWWorld::Ptr ptr = R()(runtime);
+
+                    InterpreterContext& context =
+                        static_cast<InterpreterContext&> (runtime.getContext());
+
+                    std::string group = runtime.getStringLiteral (runtime[0].mInteger);
+                    runtime.pop();
+
+                    Interpreter::Type_Integer mode = 0;
+
+                    if (arg0==1)
+                    {
+                        mode = runtime[0].mInteger;
+                        runtime.pop();
+
+                        if (mode<0 || mode>2)
+                            throw std::runtime_error ("animation mode out of range");
+                    }
+
+                    context.getWorld().playAnimationGroup (ptr, group, mode, 1);
+               }
+        };
+
+        template<class R>
+        class OpLoopAnim : public Interpreter::Opcode1
+        {
+            public:
+
+                virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
+                {
+                    MWWorld::Ptr ptr = R()(runtime);
+
+                    InterpreterContext& context =
+                        static_cast<InterpreterContext&> (runtime.getContext());
+
+                    std::string group = runtime.getStringLiteral (runtime[0].mInteger);
+                    runtime.pop();
+
+                    Interpreter::Type_Integer loops = runtime[0].mInteger;
+                    runtime.pop();
+
+                    if (loops<0)
+                        throw std::runtime_error ("number of animation loops must be non-negative");
+
+                    Interpreter::Type_Integer mode = 0;
+
+                    if (arg0==1)
+                    {
+                        mode = runtime[0].mInteger;
+                        runtime.pop();
+
+                        if (mode<0 || mode>2)
+                            throw std::runtime_error ("animation mode out of range");
+                    }
+
+                    context.getWorld().playAnimationGroup (ptr, group, mode, loops);
+               }
+        };
+
+        const int opcodeSkipAnim = 0x2000138;
+        const int opcodeSkipAnimExplicit = 0x2000139;
+        const int opcodePlayAnim = 0x20006;
+        const int opcodePlayAnimExplicit = 0x20007;
+        const int opcodeLoopAnim = 0x20008;
+        const int opcodeLoopAnimExplicit = 0x20009;
+
+        void registerExtensions (Compiler::Extensions& extensions)
+        {
+            extensions.registerInstruction ("skipanim", "", opcodeSkipAnim, opcodeSkipAnimExplicit);
+            extensions.registerInstruction ("playgroup", "c/l", opcodePlayAnim, opcodePlayAnimExplicit);
+            extensions.registerInstruction ("loopgroup", "cl/l", opcodeLoopAnim, opcodeLoopAnimExplicit);
+        }
+
+        void installOpcodes (Interpreter::Interpreter& interpreter)
+        {
+            interpreter.installSegment5 (opcodeSkipAnim, new OpSkipAnim<ImplicitRef>);
+            interpreter.installSegment5 (opcodeSkipAnimExplicit, new OpSkipAnim<ExplicitRef>);
+            interpreter.installSegment3 (opcodePlayAnim, new OpPlayAnim<ImplicitRef>);
+            interpreter.installSegment3 (opcodePlayAnimExplicit, new OpPlayAnim<ExplicitRef>);
+            interpreter.installSegment3 (opcodeLoopAnim, new OpLoopAnim<ImplicitRef>);
+            interpreter.installSegment3 (opcodeLoopAnimExplicit, new OpLoopAnim<ExplicitRef>);
+        }
+    }
+}
diff --git a/apps/openmw/mwscript/animationextensions.hpp b/apps/openmw/mwscript/animationextensions.hpp
new file mode 100644
index 0000000000..ff619ab73a
--- /dev/null
+++ b/apps/openmw/mwscript/animationextensions.hpp
@@ -0,0 +1,24 @@
+#ifndef GAME_SCRIPT_ANIMATIONEXTENSIONS_H
+#define GAME_SCRIPT_ANIMATIONEXTENSIONS_H
+
+namespace Compiler
+{
+    class Extensions;
+}
+
+namespace Interpreter
+{
+    class Interpreter;
+}
+
+namespace MWScript
+{
+    namespace Animation
+    {
+        void registerExtensions (Compiler::Extensions& extensions);
+
+        void installOpcodes (Interpreter::Interpreter& interpreter);
+    }
+}
+
+#endif
diff --git a/apps/openmw/mwscript/containerextensions.cpp b/apps/openmw/mwscript/containerextensions.cpp
index aef48ddecd..a0aba5db9a 100644
--- a/apps/openmw/mwscript/containerextensions.cpp
+++ b/apps/openmw/mwscript/containerextensions.cpp
@@ -11,7 +11,7 @@
 
 #include "../mwworld/manualref.hpp"
 #include "../mwworld/class.hpp"
-#include "../mwworld/containerutil.hpp"
+#include "../mwworld/containerstore.hpp"
 
 #include "interpretercontext.hpp"
 #include "ref.hpp"
@@ -45,8 +45,7 @@ namespace MWScript
 
                     ref.getPtr().getRefData().setCount (count);
 
-                    MWWorld::Class::get (ref.getPtr()).insertIntoContainer (ref.getPtr(),
-                        MWWorld::Class::get (ptr).getContainerStore (ptr));
+                    MWWorld::Class::get (ptr).getContainerStore (ptr).add (ref.getPtr());
                 }
         };
 
@@ -59,25 +58,16 @@ namespace MWScript
                 {
                     MWWorld::Ptr ptr = R()(runtime);
 
-                    MWScript::InterpreterContext& context
-                        = static_cast<MWScript::InterpreterContext&> (runtime.getContext());
-
                     std::string item = runtime.getStringLiteral (runtime[0].mInteger);
                     runtime.pop();
 
-                    std::vector<MWWorld::Ptr> list;
-
-                    MWWorld::listItemsInContainer (item,
-                        MWWorld::Class::get (ptr).getContainerStore (ptr),
-                        context.getWorld().getStore(), list);
+                    MWWorld::ContainerStore& store = MWWorld::Class::get (ptr).getContainerStore (ptr);
 
                     Interpreter::Type_Integer sum = 0;
 
-                    for (std::vector<MWWorld::Ptr>::iterator iter (list.begin()); iter!=list.end();
-                        ++iter)
-                    {
-                        sum += iter->getRefData().getCount();
-                    }
+                    for (MWWorld::ContainerStoreIterator iter (store.begin()); iter!=store.end(); ++iter)
+                        if (iter->getCellRef().refID==item)
+                            sum += iter->getRefData().getCount();
 
                     runtime.push (sum);
                 }
@@ -92,9 +82,6 @@ namespace MWScript
                 {
                     MWWorld::Ptr ptr = R()(runtime);
 
-                    MWScript::InterpreterContext& context
-                        = static_cast<MWScript::InterpreterContext&> (runtime.getContext());
-
                     std::string item = runtime.getStringLiteral (runtime[0].mInteger);
                     runtime.pop();
 
@@ -104,25 +91,23 @@ namespace MWScript
                     if (count<0)
                         throw std::runtime_error ("second argument for RemoveItem must be non-negative");
 
-                    std::vector<MWWorld::Ptr> list;
+                    MWWorld::ContainerStore& store = MWWorld::Class::get (ptr).getContainerStore (ptr);
 
-                    MWWorld::listItemsInContainer (item,
-                        MWWorld::Class::get (ptr).getContainerStore (ptr),
-                        context.getWorld().getStore(), list);
-
-                    for (std::vector<MWWorld::Ptr>::iterator iter (list.begin());
-                        iter!=list.end() && count;
+                    for (MWWorld::ContainerStoreIterator iter (store.begin()); iter!=store.end() && count;
                         ++iter)
                     {
-                        if (iter->getRefData().getCount()<=count)
+                        if (iter->getCellRef().refID==item)
                         {
-                            count -= iter->getRefData().getCount();
-                            iter->getRefData().setCount (0);
-                        }
-                        else
-                        {
-                            iter->getRefData().setCount (iter->getRefData().getCount()-count);
-                            count = 0;
+                            if (iter->getRefData().getCount()<=count)
+                            {
+                                count -= iter->getRefData().getCount();
+                                iter->getRefData().setCount (0);
+                            }
+                            else
+                            {
+                                iter->getRefData().setCount (iter->getRefData().getCount()-count);
+                                count = 0;
+                            }
                         }
                     }
 
diff --git a/apps/openmw/mwscript/controlextensions.cpp b/apps/openmw/mwscript/controlextensions.cpp
index 893af259fc..384e13e450 100644
--- a/apps/openmw/mwscript/controlextensions.cpp
+++ b/apps/openmw/mwscript/controlextensions.cpp
@@ -1,5 +1,5 @@
 
-#include "statsextensions.hpp"
+#include "controlextensions.hpp"
 
 #include <components/compiler/extensions.hpp>
 
@@ -48,7 +48,7 @@ namespace MWScript
 
                     bool enabled = context.getWorld().toggleCollisionMode();
 
-                    context.report (enabled ? "Collsion -> On" : "Collision -> Off");
+                    context.report (enabled ? "Collision -> On" : "Collision -> Off");
                 }
         };
 
diff --git a/apps/openmw/mwscript/docs/vmformat.txt b/apps/openmw/mwscript/docs/vmformat.txt
index 33ce38cdd7..09b0c04825 100644
--- a/apps/openmw/mwscript/docs/vmformat.txt
+++ b/apps/openmw/mwscript/docs/vmformat.txt
@@ -19,7 +19,11 @@ op 0x20002: AiEscort
 op 0x20003: AiEscort, explicit reference
 op 0x20004: Lock
 op 0x20005: Lock, explicit reference
-opcodes 0x20006-0x3ffff unused
+op 0x20006: PlayAnim
+op 0x20007: PlayAnim, explicit reference
+op 0x20008: LoopAnim
+op 0x20009: LoopAnim, explicit reference
+opcodes 0x2000a-0x3ffff unused
 
 Segment 4:
 (not implemented yet)
@@ -109,4 +113,12 @@ op 0x2000134: SetJournalIndex
 op 0x2000135: GetJournalIndex
 op 0x2000136: GetPCCell
 op 0x2000137: GetButtonPressed
-opcodes 0x2000138-0x3ffffff unused
+op 0x2000138: SkipAnim
+op 0x2000139: SkipAnim, expplicit reference
+op 0x200013b: twf
+op 0x200013c: FadeIn
+op 0x200013d: FadeOut
+op 0x200013e: FadeTo
+op 0x200013f: GetCurrentWeather
+op 0x2000140: ChangeWeather
+opcodes 0x2000141-0x3ffffff unused
diff --git a/apps/openmw/mwscript/extensions.cpp b/apps/openmw/mwscript/extensions.cpp
index 86161d2b18..1974941461 100644
--- a/apps/openmw/mwscript/extensions.cpp
+++ b/apps/openmw/mwscript/extensions.cpp
@@ -14,6 +14,7 @@
 #include "aiextensions.hpp"
 #include "controlextensions.hpp"
 #include "dialogueextensions.hpp"
+#include "animationextensions.hpp"
 
 namespace MWScript
 {
@@ -29,6 +30,7 @@ namespace MWScript
         Ai::registerExtensions (extensions);
         Control::registerExtensions (extensions);
         Dialogue::registerExtensions (extensions);
+        Animation::registerExtensions (extensions);
     }
 
     void installOpcodes (Interpreter::Interpreter& interpreter)
@@ -44,5 +46,6 @@ namespace MWScript
         Ai::installOpcodes (interpreter);
         Control::installOpcodes (interpreter);
         Dialogue::installOpcodes (interpreter);
+        Animation::installOpcodes (interpreter);
     }
 }
diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp
index d8dfbdde47..5bfffd3a26 100644
--- a/apps/openmw/mwscript/miscextensions.cpp
+++ b/apps/openmw/mwscript/miscextensions.cpp
@@ -103,7 +103,75 @@ namespace MWScript
                         context.getWorld().toggleRenderMode (MWWorld::World::Render_CollisionDebug);
 
                     context.report (enabled ?
-                        "Collsion Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
+                        "Collision Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
+                }
+        };
+        
+        class OpToggleWireframe : public Interpreter::Opcode0
+        {
+            public:
+
+                virtual void execute (Interpreter::Runtime& runtime)
+                {
+                    InterpreterContext& context =
+                        static_cast<InterpreterContext&> (runtime.getContext());
+
+                    bool enabled =
+                        context.getWorld().toggleRenderMode (MWWorld::World::Render_Wireframe);
+
+                    context.report (enabled ?
+                        "Wireframe Rendering -> On" : "Wireframe Rendering -> Off");
+                }
+        };
+        
+        class OpFadeIn : public Interpreter::Opcode0
+        {
+            public:
+
+                virtual void execute (Interpreter::Runtime& runtime)
+                {
+                    InterpreterContext& context =
+                        static_cast<InterpreterContext&> (runtime.getContext());
+
+                    Interpreter::Type_Float time = runtime[0].mFloat;
+                    runtime.pop();
+                    
+                    context.getWorld().getFader()->fadeIn(time);
+                }
+        };
+        
+        class OpFadeOut : public Interpreter::Opcode0
+        {
+            public:
+
+                virtual void execute (Interpreter::Runtime& runtime)
+                {
+                    InterpreterContext& context =
+                        static_cast<InterpreterContext&> (runtime.getContext());
+
+                    Interpreter::Type_Float time = runtime[0].mFloat;
+                    runtime.pop();
+                    
+                    context.getWorld().getFader()->fadeOut(time);
+                }
+        };
+        
+        class OpFadeTo : public Interpreter::Opcode0
+        {
+            public:
+
+                virtual void execute (Interpreter::Runtime& runtime)
+                {
+                    InterpreterContext& context =
+                        static_cast<InterpreterContext&> (runtime.getContext());
+
+                    Interpreter::Type_Float alpha = runtime[0].mFloat;
+                    runtime.pop();
+                    
+                    Interpreter::Type_Float time = runtime[0].mFloat;
+                    runtime.pop();
+                    
+                    context.getWorld().getFader()->fadeTo(alpha, time);
                 }
         };
 
@@ -115,6 +183,10 @@ namespace MWScript
         const int opcodeUnlock = 0x200008c;
         const int opcodeUnlockExplicit = 0x200008d;
         const int opcodeToggleCollisionDebug = 0x2000132;
+        const int opcodeToggleWireframe = 0x200013b;
+        const int opcodeFadeIn = 0x200013c;
+        const int opcodeFadeOut = 0x200013d;
+        const int opcodeFadeTo = 0x200013e;
 
         void registerExtensions (Compiler::Extensions& extensions)
         {
@@ -127,6 +199,11 @@ namespace MWScript
             extensions.registerInstruction ("togglecollisiongrid", "", opcodeToggleCollisionDebug);
             extensions.registerInstruction ("tcb", "", opcodeToggleCollisionDebug);
             extensions.registerInstruction ("tcg", "", opcodeToggleCollisionDebug);
+            extensions.registerInstruction ("twf", "", opcodeToggleWireframe);
+            extensions.registerInstruction ("togglewireframe", "", opcodeToggleWireframe);
+            extensions.registerInstruction ("fadein", "f", opcodeFadeIn);
+            extensions.registerInstruction ("fadeout", "f", opcodeFadeOut);
+            extensions.registerInstruction ("fadeto", "ff", opcodeFadeTo);
         }
 
         void installOpcodes (Interpreter::Interpreter& interpreter)
@@ -139,6 +216,10 @@ namespace MWScript
             interpreter.installSegment5 (opcodeUnlock, new OpUnlock<ImplicitRef>);
             interpreter.installSegment5 (opcodeUnlockExplicit, new OpUnlock<ExplicitRef>);
             interpreter.installSegment5 (opcodeToggleCollisionDebug, new OpToggleCollisionDebug);
+            interpreter.installSegment5 (opcodeToggleWireframe, new OpToggleWireframe);
+            interpreter.installSegment5 (opcodeFadeIn, new OpFadeIn);
+            interpreter.installSegment5 (opcodeFadeOut, new OpFadeOut);
+            interpreter.installSegment5 (opcodeFadeTo, new OpFadeTo);
         }
     }
 }
diff --git a/apps/openmw/mwscript/skyextensions.cpp b/apps/openmw/mwscript/skyextensions.cpp
index caa07c0952..a5cc9e2138 100644
--- a/apps/openmw/mwscript/skyextensions.cpp
+++ b/apps/openmw/mwscript/skyextensions.cpp
@@ -79,12 +79,46 @@ namespace MWScript
                     runtime.push (context.getWorld().getSecundaPhase());
                 }
         };
+        
+        class OpGetCurrentWeather : public Interpreter::Opcode0
+        {
+            public:
+                
+                virtual void execute (Interpreter::Runtime& runtime)
+                {
+                    InterpreterContext& context =
+                        static_cast<InterpreterContext&> (runtime.getContext());
+                    
+                    runtime.push (context.getWorld().getCurrentWeather());
+                }
+        };
+        
+        class OpChangeWeather : public Interpreter::Opcode0
+        {
+            public:
+            
+                virtual void execute (Interpreter::Runtime& runtime)
+                {
+                    InterpreterContext& context =
+                        static_cast<InterpreterContext&> (runtime.getContext());
+                    
+                    std::string region = runtime.getStringLiteral (runtime[0].mInteger);
+                    runtime.pop();
+                    
+                    Interpreter::Type_Integer id = runtime[0].mInteger;
+                    runtime.pop();
+                    
+                    context.getWorld().changeWeather(region, id);
+                }
+        };
 
         const int opcodeToggleSky = 0x2000021;
         const int opcodeTurnMoonWhite = 0x2000022;
         const int opcodeTurnMoonRed = 0x2000023;
         const int opcodeGetMasserPhase = 0x2000024;
         const int opcodeGetSecundaPhase = 0x2000025;
+        const int opcodeGetCurrentWeather = 0x200013f;
+        const int opcodeChangeWeather = 0x2000140;
 
         void registerExtensions (Compiler::Extensions& extensions)
         {
@@ -92,8 +126,10 @@ namespace MWScript
             extensions.registerInstruction ("ts", "", opcodeToggleSky);
             extensions.registerInstruction ("turnmoonwhite", "", opcodeTurnMoonWhite);
             extensions.registerInstruction ("turnmoonred", "", opcodeTurnMoonRed);
+            extensions.registerInstruction ("changeweather", "Sl", opcodeChangeWeather);
             extensions.registerFunction ("getmasserphase", 'l', "", opcodeGetMasserPhase);
             extensions.registerFunction ("getsecundaphase", 'l', "", opcodeGetSecundaPhase);
+            extensions.registerFunction ("getcurrentweather", 'l', "", opcodeGetCurrentWeather);
         }
 
         void installOpcodes (Interpreter::Interpreter& interpreter)
@@ -103,6 +139,8 @@ namespace MWScript
             interpreter.installSegment5 (opcodeTurnMoonRed, new OpTurnMoonRed);
             interpreter.installSegment5 (opcodeGetMasserPhase, new OpGetMasserPhase);
             interpreter.installSegment5 (opcodeGetSecundaPhase, new OpGetSecundaPhase);
+            interpreter.installSegment5 (opcodeGetCurrentWeather, new OpGetCurrentWeather);
+            interpreter.installSegment5 (opcodeChangeWeather, new OpChangeWeather);
         }
     }
 }
diff --git a/apps/openmw/mwscript/statsextensions.cpp b/apps/openmw/mwscript/statsextensions.cpp
index ca82830d93..0e97a39cf4 100644
--- a/apps/openmw/mwscript/statsextensions.cpp
+++ b/apps/openmw/mwscript/statsextensions.cpp
@@ -10,6 +10,7 @@
 #include "../mwworld/class.hpp"
 
 #include "../mwmechanics/creaturestats.hpp"
+#include "../mwmechanics/npcstats.hpp"
 
 #include "interpretercontext.hpp"
 #include "ref.hpp"
diff --git a/apps/openmw/mwworld/actiontake.cpp b/apps/openmw/mwworld/actiontake.cpp
index b318f07963..bbe9540497 100644
--- a/apps/openmw/mwworld/actiontake.cpp
+++ b/apps/openmw/mwworld/actiontake.cpp
@@ -4,6 +4,7 @@
 #include "class.hpp"
 #include "environment.hpp"
 #include "world.hpp"
+#include "containerstore.hpp"
 
 namespace MWWorld
 {
@@ -14,8 +15,7 @@ namespace MWWorld
         // insert into player's inventory
         MWWorld::Ptr player = environment.mWorld->getPtr ("player", true);
 
-        MWWorld::Class::get (mObject).insertIntoContainer (mObject,
-            MWWorld::Class::get (player).getContainerStore (player));
+        MWWorld::Class::get (player).getContainerStore (player).add (mObject);
 
         // remove from world
         environment.mWorld->deleteObject (mObject);
diff --git a/apps/openmw/mwworld/cells.cpp b/apps/openmw/mwworld/cells.cpp
index 143ce557b5..079c888aa6 100644
--- a/apps/openmw/mwworld/cells.cpp
+++ b/apps/openmw/mwworld/cells.cpp
@@ -63,10 +63,11 @@ MWWorld::Ptr::CellStore *MWWorld::Cells::getExterior (int x, int y)
 
         result = mExteriors.insert (std::make_pair (
             std::make_pair (x, y), Ptr::CellStore (cell))).first;
-
-        result->second.load (mStore, mReader);
     }
 
+    if (result->second.mState!=Ptr::CellStore::State_Loaded)
+        result->second.load (mStore, mReader);
+
     return &result->second;
 }
 
@@ -79,10 +80,11 @@ MWWorld::Ptr::CellStore *MWWorld::Cells::getInterior (const std::string& name)
         const ESM::Cell *cell = mStore.cells.findInt (name);
 
         result = mInteriors.insert (std::make_pair (name, Ptr::CellStore (cell))).first;
-
-        result->second.load (mStore, mReader);
     }
 
+    if (result->second.mState!=Ptr::CellStore::State_Loaded)
+        result->second.load (mStore, mReader);
+
     return &result->second;
 }
 
diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp
index b4f93576a0..641da73e1e 100644
--- a/apps/openmw/mwworld/class.cpp
+++ b/apps/openmw/mwworld/class.cpp
@@ -7,6 +7,7 @@
 
 #include "ptr.hpp"
 #include "nullaction.hpp"
+#include "containerstore.hpp"
 
 namespace MWWorld
 {
@@ -71,16 +72,11 @@ namespace MWWorld
         return boost::shared_ptr<Action> (new NullAction);
     }
 
-    ContainerStore<RefData>& Class::getContainerStore (const Ptr& ptr) const
+    ContainerStore& Class::getContainerStore (const Ptr& ptr) const
     {
         throw std::runtime_error ("class does not have a container store");
     }
 
-    void Class::insertIntoContainer (const Ptr& ptr, ContainerStore<RefData>& containerStore) const
-    {
-        throw std::runtime_error ("class does not support inserting into a container");
-    }
-
     void Class::lock (const Ptr& ptr, int lockLevel) const
     {
         throw std::runtime_error ("class does not support locking");
diff --git a/apps/openmw/mwworld/class.hpp b/apps/openmw/mwworld/class.hpp
index 706b11aaad..9b6acb3ce3 100644
--- a/apps/openmw/mwworld/class.hpp
+++ b/apps/openmw/mwworld/class.hpp
@@ -7,11 +7,11 @@
 #include <boost/shared_ptr.hpp>
 
 #include "action.hpp"
-#include "containerstore.hpp"
 #include "refdata.hpp"
-#include "../mwrender/renderinginterface.hpp"
 #include "physicssystem.hpp"
 
+#include "../mwrender/renderinginterface.hpp"
+
 namespace Ogre
 {
     class Vector3;
@@ -33,6 +33,7 @@ namespace MWWorld
 {
     class Ptr;
     class Environment;
+    class ContainerStore;
 
     /// \brief Base class for referenceable esm records
     class Class
@@ -61,8 +62,6 @@ namespace MWWorld
             ///< Return ID of \a ptr or throw an exception, if class does not support ID retrieval
             /// (default implementation: throw an exception)
 
-
-
             virtual void insertObjectRendering (const Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
             virtual void insertObject(const Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
             ///< Add reference into a cell for rendering (default implementation: don't render anything).
@@ -105,15 +104,10 @@ namespace MWWorld
             ///< Generate action for using via inventory menu (default implementation: return a
             /// null action).
 
-            virtual ContainerStore<RefData>& getContainerStore (const Ptr& ptr) const;
+            virtual ContainerStore& getContainerStore (const Ptr& ptr) const;
             ///< Return container store or throw an exception, if class does not have a
             /// container store (default implementation: throw an exceoption)
 
-            virtual void insertIntoContainer (const Ptr& ptr, ContainerStore<RefData>& containerStore)
-                const;
-            ///< Insert into a container or throw an exception, if class does not support inserting into
-            /// a container.
-
             virtual void lock (const Ptr& ptr, int lockLevel) const;
             ///< Lock object (default implementation: throw an exception)
 
diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp
new file mode 100644
index 0000000000..54908deec1
--- /dev/null
+++ b/apps/openmw/mwworld/containerstore.cpp
@@ -0,0 +1,342 @@
+
+#include "containerstore.hpp"
+
+#include <cassert>
+#include <typeinfo>
+#include <stdexcept>
+
+MWWorld::ContainerStoreIterator MWWorld::ContainerStore::begin (int mask)
+{
+    return ContainerStoreIterator (mask, this);
+}
+
+MWWorld::ContainerStoreIterator MWWorld::ContainerStore::end()
+{
+    return ContainerStoreIterator (this);
+}
+
+void MWWorld::ContainerStore::add (const Ptr& ptr)
+{
+    /// \todo implement item stocking
+
+    switch (getType (ptr))
+    {
+        case Type_Potion: potions.list.push_back (*ptr.get<ESM::Potion>());  break;
+        case Type_Apparatus: appas.list.push_back (*ptr.get<ESM::Apparatus>());  break;
+        case Type_Armor: armors.list.push_back (*ptr.get<ESM::Armor>());  break;
+        case Type_Book: books.list.push_back (*ptr.get<ESM::Book>());  break;
+        case Type_Clothing: clothes.list.push_back (*ptr.get<ESM::Clothing>());  break;
+        case Type_Ingredient: ingreds.list.push_back (*ptr.get<ESM::Ingredient>());  break;
+        case Type_Light: lights.list.push_back (*ptr.get<ESM::Light>());  break;
+        case Type_Lockpick: lockpicks.list.push_back (*ptr.get<ESM::Tool>());  break;
+        case Type_Miscellaneous: miscItems.list.push_back (*ptr.get<ESM::Miscellaneous>());  break;
+        case Type_Probe: probes.list.push_back (*ptr.get<ESM::Probe>());  break;
+        case Type_Repair: repairs.list.push_back (*ptr.get<ESM::Repair>());  break;
+        case Type_Weapon: weapons.list.push_back (*ptr.get<ESM::Weapon>());  break;
+    }
+}
+
+int MWWorld::ContainerStore::getType (const Ptr& ptr)
+{
+    if (ptr.isEmpty())
+        throw std::runtime_error ("can't put a non-existent object into a container");
+
+    if (ptr.getTypeName()==typeid (ESM::Potion).name())
+        return Type_Potion;
+
+    if (ptr.getTypeName()==typeid (ESM::Apparatus).name())
+        return Type_Apparatus;
+
+    if (ptr.getTypeName()==typeid (ESM::Armor).name())
+        return Type_Armor;
+
+    if (ptr.getTypeName()==typeid (ESM::Book).name())
+        return Type_Book;
+
+    if (ptr.getTypeName()==typeid (ESM::Clothing).name())
+        return Type_Clothing;
+
+    if (ptr.getTypeName()==typeid (ESM::Ingredient).name())
+        return Type_Ingredient;
+
+    if (ptr.getTypeName()==typeid (ESM::Light).name())
+        return Type_Light;
+
+    if (ptr.getTypeName()==typeid (ESM::Tool).name())
+        return Type_Lockpick;
+
+    if (ptr.getTypeName()==typeid (ESM::Miscellaneous).name())
+        return Type_Miscellaneous;
+
+    if (ptr.getTypeName()==typeid (ESM::Probe).name())
+        return Type_Probe;
+
+    if (ptr.getTypeName()==typeid (ESM::Repair).name())
+        return Type_Repair;
+
+    if (ptr.getTypeName()==typeid (ESM::Weapon).name())
+        return Type_Weapon;
+
+    throw std::runtime_error (
+        "Object of type " + ptr.getTypeName() + " can not be placed into a container");
+}
+
+
+MWWorld::ContainerStoreIterator::ContainerStoreIterator (ContainerStore *container)
+: mType (-1), mMask (0), mContainer (container)
+{}
+
+MWWorld::ContainerStoreIterator::ContainerStoreIterator (int mask, ContainerStore *container)
+: mType (0), mMask (mask), mContainer (container)
+{
+    nextType();
+}
+
+void MWWorld::ContainerStoreIterator::incType()
+{
+    if (mType==0)
+        mType = 1;
+    else if (mType!=-1)
+    {
+        mType <<= 1;
+
+        if (mType>ContainerStore::Type_Last)
+            mType = -1;
+    }
+}
+
+void MWWorld::ContainerStoreIterator::nextType()
+{
+    while (mType!=-1)
+    {
+        incType();
+
+        if (mType & mMask)
+            if (resetIterator())
+                break;
+    }
+}
+
+bool MWWorld::ContainerStoreIterator::resetIterator()
+{
+    switch (mType)
+    {
+        case ContainerStore::Type_Potion:
+
+            mPotion = mContainer->potions.list.begin();
+            return mPotion!=mContainer->potions.list.end();
+
+        case ContainerStore::Type_Apparatus:
+
+            mApparatus = mContainer->appas.list.begin();
+            return mApparatus!=mContainer->appas.list.end();
+
+        case ContainerStore::Type_Armor:
+
+            mArmor = mContainer->armors.list.begin();
+            return mArmor!=mContainer->armors.list.end();
+
+        case ContainerStore::Type_Book:
+
+            mBook = mContainer->books.list.begin();
+            return mBook!=mContainer->books.list.end();
+
+        case ContainerStore::Type_Clothing:
+
+            mClothing = mContainer->clothes.list.begin();
+            return mClothing!=mContainer->clothes.list.end();
+
+        case ContainerStore::Type_Ingredient:
+
+            mIngredient = mContainer->ingreds.list.begin();
+            return mIngredient!=mContainer->ingreds.list.end();
+
+        case ContainerStore::Type_Light:
+
+            mLight = mContainer->lights.list.begin();
+            return mLight!=mContainer->lights.list.end();
+
+        case ContainerStore::Type_Lockpick:
+
+            mLockpick = mContainer->lockpicks.list.begin();
+            return mLockpick!=mContainer->lockpicks.list.end();
+
+        case ContainerStore::Type_Miscellaneous:
+
+            mMiscellaneous = mContainer->miscItems.list.begin();
+            return mMiscellaneous!=mContainer->miscItems.list.end();
+
+        case ContainerStore::Type_Probe:
+
+            mProbe = mContainer->probes.list.begin();
+            return mProbe!=mContainer->probes.list.end();
+
+        case ContainerStore::Type_Repair:
+
+            mRepair = mContainer->repairs.list.begin();
+            return mRepair!=mContainer->repairs.list.end();
+
+        case ContainerStore::Type_Weapon:
+
+            mWeapon = mContainer->weapons.list.begin();
+            return mWeapon!=mContainer->weapons.list.end();
+    }
+
+    return false;
+}
+
+bool MWWorld::ContainerStoreIterator::incIterator()
+{
+    switch (mType)
+    {
+        case ContainerStore::Type_Potion:
+
+            ++mPotion;
+            return mPotion==mContainer->potions.list.end();
+
+        case ContainerStore::Type_Apparatus:
+
+            ++mApparatus;
+            return mApparatus==mContainer->appas.list.end();
+
+        case ContainerStore::Type_Armor:
+
+            ++mArmor;
+            return mArmor==mContainer->armors.list.end();
+
+        case ContainerStore::Type_Book:
+
+            ++mBook;
+            return mBook==mContainer->books.list.end();
+
+        case ContainerStore::Type_Clothing:
+
+            ++mClothing;
+            return mClothing==mContainer->clothes.list.end();
+
+        case ContainerStore::Type_Ingredient:
+
+            ++mIngredient;
+            return mIngredient==mContainer->ingreds.list.end();
+
+        case ContainerStore::Type_Light:
+
+            ++mLight;
+            return mLight==mContainer->lights.list.end();
+
+        case ContainerStore::Type_Lockpick:
+
+            ++mLockpick;
+            return mLockpick==mContainer->lockpicks.list.end();
+
+        case ContainerStore::Type_Miscellaneous:
+
+            ++mMiscellaneous;
+            return mMiscellaneous==mContainer->miscItems.list.end();
+
+        case ContainerStore::Type_Probe:
+
+            ++mProbe;
+            return mProbe==mContainer->probes.list.end();
+
+        case ContainerStore::Type_Repair:
+
+            ++mRepair;
+            return mRepair==mContainer->repairs.list.end();
+
+        case ContainerStore::Type_Weapon:
+
+            ++mWeapon;
+            return mWeapon==mContainer->weapons.list.end();
+    }
+
+    return true;
+}
+
+MWWorld::Ptr *MWWorld::ContainerStoreIterator::operator->() const
+{
+    mPtr = **this;
+    return &mPtr;
+}
+
+MWWorld::Ptr MWWorld::ContainerStoreIterator::operator*() const
+{
+    switch (mType)
+    {
+        case ContainerStore::Type_Potion: return MWWorld::Ptr (&*mPotion, 0);
+        case ContainerStore::Type_Apparatus: return MWWorld::Ptr (&*mApparatus, 0);
+        case ContainerStore::Type_Armor: return MWWorld::Ptr (&*mArmor, 0);
+        case ContainerStore::Type_Book: return MWWorld::Ptr (&*mBook, 0);
+        case ContainerStore::Type_Clothing: return MWWorld::Ptr (&*mClothing, 0);
+        case ContainerStore::Type_Ingredient: return MWWorld::Ptr (&*mIngredient, 0);
+        case ContainerStore::Type_Light: return MWWorld::Ptr (&*mLight, 0);
+        case ContainerStore::Type_Lockpick: return MWWorld::Ptr (&*mLockpick, 0);
+        case ContainerStore::Type_Miscellaneous: return MWWorld::Ptr (&*mMiscellaneous, 0);
+        case ContainerStore::Type_Probe: return MWWorld::Ptr (&*mProbe, 0);
+        case ContainerStore::Type_Repair: return MWWorld::Ptr (&*mRepair, 0);
+        case ContainerStore::Type_Weapon: return MWWorld::Ptr (&*mWeapon, 0);
+    }
+
+    throw std::runtime_error ("invalid pointer");
+}
+
+MWWorld::ContainerStoreIterator& MWWorld::ContainerStoreIterator::operator++()
+{
+    do
+    {
+        if (incIterator())
+            nextType();
+    }
+    while (mType!=-1 && !(**this).getRefData().getCount());
+
+    return *this;
+}
+
+MWWorld::ContainerStoreIterator MWWorld::ContainerStoreIterator::operator++ (int)
+{
+    ContainerStoreIterator iter (*this);
+    ++*this;
+    return iter;
+}
+
+bool MWWorld::ContainerStoreIterator::isEqual (const ContainerStoreIterator& iter) const
+{
+    assert (mContainer==iter.mContainer);
+
+    if (mType!=iter.mType)
+        return false;
+
+    switch (mType)
+    {
+        case ContainerStore::Type_Potion: return mPotion==iter.mPotion;
+        case ContainerStore::Type_Apparatus: return mApparatus==iter.mApparatus;
+        case ContainerStore::Type_Armor: return mArmor==iter.mArmor;
+        case ContainerStore::Type_Book: return mBook==iter.mBook;
+        case ContainerStore::Type_Clothing: return mClothing==iter.mClothing;
+        case ContainerStore::Type_Ingredient: return mIngredient==iter.mIngredient;
+        case ContainerStore::Type_Light: return mLight==iter.mLight;
+        case ContainerStore::Type_Lockpick: return mLockpick==iter.mLockpick;
+        case ContainerStore::Type_Miscellaneous: return mMiscellaneous==iter.mMiscellaneous;
+        case ContainerStore::Type_Probe: return mProbe==iter.mProbe;
+        case ContainerStore::Type_Repair: return mRepair==iter.mRepair;
+        case ContainerStore::Type_Weapon: return mWeapon==iter.mWeapon;
+        case -1: return true;
+    }
+
+    return false;
+}
+
+int MWWorld::ContainerStoreIterator::getType() const
+{
+    return mType;
+}
+
+bool MWWorld::operator== (const ContainerStoreIterator& left, const ContainerStoreIterator& right)
+{
+    return left.isEqual (right);
+}
+
+bool MWWorld::operator!= (const ContainerStoreIterator& left, const ContainerStoreIterator& right)
+{
+    return !(left==right);
+}
diff --git a/apps/openmw/mwworld/containerstore.hpp b/apps/openmw/mwworld/containerstore.hpp
index 971a79c15a..7263245f36 100644
--- a/apps/openmw/mwworld/containerstore.hpp
+++ b/apps/openmw/mwworld/containerstore.hpp
@@ -3,24 +3,134 @@
 
 #include <components/esm_store/cell_store.hpp>
 
+#include "refdata.hpp"
+#include "ptr.hpp"
+
 namespace MWWorld
 {
-    template<typename D>
-    struct ContainerStore
+    class ContainerStoreIterator;
+
+    class ContainerStore
     {
-            ESMS::CellRefList<ESM::Potion, D>            potions;
-            ESMS::CellRefList<ESM::Apparatus, D>         appas;
-            ESMS::CellRefList<ESM::Armor, D>             armors;
-            ESMS::CellRefList<ESM::Book, D>              books;
-            ESMS::CellRefList<ESM::Clothing, D>          clothes;
-            ESMS::CellRefList<ESM::Ingredient, D>        ingreds;
-            ESMS::CellRefList<ESM::Light, D>             lights;
-            ESMS::CellRefList<ESM::Tool, D>              lockpicks;
-            ESMS::CellRefList<ESM::Miscellaneous, D>     miscItems;
-            ESMS::CellRefList<ESM::Probe, D>             probes;
-            ESMS::CellRefList<ESM::Repair, D>            repairs;
-            ESMS::CellRefList<ESM::Weapon, D>            weapons;
+        public:
+
+            static const int Type_Potion = 0x0001;
+            static const int Type_Apparatus = 0x0002;
+            static const int Type_Armor = 0x0004;
+            static const int Type_Book = 0x0008;
+            static const int Type_Clothing = 0x0010;
+            static const int Type_Ingredient = 0x0020;
+            static const int Type_Light = 0x0040;
+            static const int Type_Lockpick = 0x0080;
+            static const int Type_Miscellaneous = 0x0100;
+            static const int Type_Probe = 0x0200;
+            static const int Type_Repair = 0x0400;
+            static const int Type_Weapon = 0x0800;
+
+            static const int Type_Last = Type_Weapon;
+
+            static const int Type_All = 0xffff;
+
+        private:
+
+            ESMS::CellRefList<ESM::Potion, RefData>            potions;
+            ESMS::CellRefList<ESM::Apparatus, RefData>         appas;
+            ESMS::CellRefList<ESM::Armor, RefData>             armors;
+            ESMS::CellRefList<ESM::Book, RefData>              books;
+            ESMS::CellRefList<ESM::Clothing, RefData>          clothes;
+            ESMS::CellRefList<ESM::Ingredient, RefData>        ingreds;
+            ESMS::CellRefList<ESM::Light, RefData>             lights;
+            ESMS::CellRefList<ESM::Tool, RefData>              lockpicks;
+            ESMS::CellRefList<ESM::Miscellaneous, RefData>     miscItems;
+            ESMS::CellRefList<ESM::Probe, RefData>             probes;
+            ESMS::CellRefList<ESM::Repair, RefData>            repairs;
+            ESMS::CellRefList<ESM::Weapon, RefData>            weapons;
+
+        public:
+
+            ContainerStoreIterator begin (int mask = Type_All);
+
+            ContainerStoreIterator end();
+
+            void add (const Ptr& ptr);
+            ///< Add the item pointed to by \a ptr to this container.
+            ///
+            /// \note The item pointed to is not required to exist beyond this function call.
+            ///
+            /// \attention Do not add items to an existing stack by increasing the count instead of
+            /// calling this function!
+
+            static int getType (const Ptr& ptr);
+            ///< This function throws an exception, if ptr does not point to an object, that can be
+            /// put into a container.
+
+        friend class ContainerStoreIterator;
     };
+
+    /// \brief Iteration over a subset of objects in a ContainerStore
+    ///
+    /// \note The iterator will automatically skip over deleted objects.
+    class ContainerStoreIterator
+    {
+            int mType;
+            int mMask;
+            ContainerStore *mContainer;
+            mutable Ptr mPtr;
+
+            ESMS::CellRefList<ESM::Potion, RefData>::List::iterator mPotion;
+            ESMS::CellRefList<ESM::Apparatus, RefData>::List::iterator mApparatus;
+            ESMS::CellRefList<ESM::Armor, RefData>::List::iterator mArmor;
+            ESMS::CellRefList<ESM::Book, RefData>::List::iterator mBook;
+            ESMS::CellRefList<ESM::Clothing, RefData>::List::iterator mClothing;
+            ESMS::CellRefList<ESM::Ingredient, RefData>::List::iterator mIngredient;
+            ESMS::CellRefList<ESM::Light, RefData>::List::iterator mLight;
+            ESMS::CellRefList<ESM::Tool, RefData>::List::iterator mLockpick;
+            ESMS::CellRefList<ESM::Miscellaneous, RefData>::List::iterator mMiscellaneous;
+            ESMS::CellRefList<ESM::Probe, RefData>::List::iterator mProbe;
+            ESMS::CellRefList<ESM::Repair, RefData>::List::iterator mRepair;
+            ESMS::CellRefList<ESM::Weapon, RefData>::List::iterator mWeapon;
+
+        private:
+
+            ContainerStoreIterator (ContainerStore *container);
+            ///< End-iterator
+
+            ContainerStoreIterator (int mask, ContainerStore *container);
+            ///< Begin-iterator
+
+            void incType();
+
+            void nextType();
+
+            bool resetIterator();
+            ///< Reset iterator for selected type.
+            ///
+            /// \return Type not empty?
+
+            bool incIterator();
+            ///< Increment iterator for selected type.
+            ///
+            /// \return reached the end?
+
+        public:
+
+            Ptr *operator->() const;
+
+            Ptr operator*() const;
+
+            ContainerStoreIterator& operator++();
+
+            ContainerStoreIterator operator++ (int);
+
+            bool isEqual (const ContainerStoreIterator& iter) const;
+
+            int getType() const;
+
+        friend class ContainerStore;
+    };
+
+    bool operator== (const ContainerStoreIterator& left, const ContainerStoreIterator& right);
+    bool operator!= (const ContainerStoreIterator& left, const ContainerStoreIterator& right);
 }
 
 #endif
diff --git a/apps/openmw/mwworld/containerutil.cpp b/apps/openmw/mwworld/containerutil.cpp
deleted file mode 100644
index 7c7e5e5e87..0000000000
--- a/apps/openmw/mwworld/containerutil.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-
-#include "containerutil.hpp"
-
-namespace
-{
-    template<typename T>
-    void listItemsInContainerImp (const std::string& id,
-        ESMS::CellRefList<T, MWWorld::RefData>& containerStore,
-        const ESMS::RecListT<T>& store, std::vector<MWWorld::Ptr>& list)
-    {
-        if (const T *record = store.search (id))
-        {
-            for (typename ESMS::CellRefList<T, MWWorld::RefData>::List::iterator iter
-                (containerStore.list.begin());
-                iter!=containerStore.list.end(); ++iter)
-            {
-                if (iter->base==record)
-                    list.push_back (MWWorld::Ptr (&*iter, 0));
-            }
-        }
-    }
-}
-
-namespace MWWorld
-{
-    void listItemsInContainer (const std::string& id,
-        ContainerStore<MWWorld::RefData>& containerStore,
-        const ESMS::ESMStore& store, std::vector<Ptr>& list)
-    {
-        listItemsInContainerImp (id, containerStore.potions, store.potions, list);
-        listItemsInContainerImp (id, containerStore.appas, store.appas, list);
-        listItemsInContainerImp (id, containerStore.armors, store.armors, list);
-        listItemsInContainerImp (id, containerStore.books, store.books, list);
-        listItemsInContainerImp (id, containerStore.clothes, store.clothes, list);
-        listItemsInContainerImp (id, containerStore.ingreds, store.ingreds, list);
-        listItemsInContainerImp (id, containerStore.lights, store.lights, list);
-        listItemsInContainerImp (id, containerStore.lockpicks, store.lockpicks, list);
-        listItemsInContainerImp (id, containerStore.miscItems, store.miscItems, list);
-        listItemsInContainerImp (id, containerStore.probes, store.probes, list);
-        listItemsInContainerImp (id, containerStore.repairs, store.repairs, list);
-        listItemsInContainerImp (id, containerStore.weapons, store.weapons, list);
-    }
-}
diff --git a/apps/openmw/mwworld/containerutil.hpp b/apps/openmw/mwworld/containerutil.hpp
deleted file mode 100644
index 21e770404b..0000000000
--- a/apps/openmw/mwworld/containerutil.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef GAME_MWWORLD_CONTAINERUTIL_H
-#define GAME_MWWORLD_CONTAINERUTIL_H
-
-#include <string>
-#include <vector>
-
-#include <components/esm_store/store.hpp>
-
-#include "containerstore.hpp"
-#include "ptr.hpp"
-#include "refdata.hpp"
-
-namespace MWWorld
-{
-    void listItemsInContainer (const std::string& id, ContainerStore<MWWorld::RefData>& containerStore,
-        const ESMS::ESMStore& store, std::vector<Ptr>& list);
-    ///< append all references with the given id to list.
-}
-
-#endif
diff --git a/apps/openmw/mwworld/customdata.hpp b/apps/openmw/mwworld/customdata.hpp
new file mode 100644
index 0000000000..588991fe40
--- /dev/null
+++ b/apps/openmw/mwworld/customdata.hpp
@@ -0,0 +1,17 @@
+#ifndef GAME_MWWORLD_CUSTOMDATA_H
+#define GAME_MWWORLD_CUSTOMDATA_H
+
+namespace MWWorld
+{
+    /// \brief Base class for the MW-class-specific part of RefData
+    class CustomData
+    {
+        public:
+
+            virtual ~CustomData() {}
+
+            virtual CustomData *clone() const = 0;
+    };
+}
+
+#endif
diff --git a/apps/openmw/mwworld/manualref.hpp b/apps/openmw/mwworld/manualref.hpp
index b4d3f70073..f8bc7d9832 100644
--- a/apps/openmw/mwworld/manualref.hpp
+++ b/apps/openmw/mwworld/manualref.hpp
@@ -82,6 +82,7 @@ namespace MWWorld
 
                 // initialise
                 ESM::CellRef& cellRef = mPtr.getCellRef();
+                cellRef.refID = name;
                 cellRef.refnum = -1;
                 cellRef.scale = 1;
                 cellRef.factIndex = 0;
diff --git a/apps/openmw/mwworld/physicssystem.cpp b/apps/openmw/mwworld/physicssystem.cpp
index eb5c3c91c8..b0da4524ed 100644
--- a/apps/openmw/mwworld/physicssystem.cpp
+++ b/apps/openmw/mwworld/physicssystem.cpp
@@ -3,6 +3,7 @@
 #include "physicssystem.hpp"
 #include "../mwworld/ptr.hpp"
 #include "../mwworld/world.hpp" // FIXME
+#include <components/nifbullet/bullet_nif_loader.hpp>
 
 #include "OgreRoot.h"
 #include "OgreRenderWindow.h"
@@ -16,16 +17,24 @@ using namespace Ogre;
 namespace MWWorld
 {
 
-    PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng) :
-        mRender(_rend), mEngine(physEng), mFreeFly (true)
+    PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend) :
+        mRender(_rend), mEngine(0), mFreeFly (true)
     {
-
+        // Create physics. shapeLoader is deleted by the physic engine
+        NifBullet::ManualBulletShapeLoader* shapeLoader = new NifBullet::ManualBulletShapeLoader();
+        mEngine = new OEngine::Physic::PhysicEngine(shapeLoader);
     }
 
     PhysicsSystem::~PhysicsSystem()
     {
-
+        delete mEngine;
+    
     }
+    OEngine::Physic::PhysicEngine* PhysicsSystem::getEngine()
+    {
+        return mEngine;
+    }
+    
 	std::pair<std::string, float> PhysicsSystem::getFacedHandle (MWWorld::World& world)
 	{
 		std::string handle = "";
@@ -41,6 +50,17 @@ namespace MWWorld
 
         return mEngine->rayTest(from,to);
     }
+    
+    bool PhysicsSystem::castRay(const Vector3& from, const Vector3& to)
+    {
+        btVector3 _from, _to;
+        _from = btVector3(from.x, from.y, from.z);
+        _to = btVector3(to.x, to.y, to.z);
+        
+        std::pair<std::string, float> result = mEngine->rayTest(_from, _to);
+        
+        return !(result.first == "");
+    }
 
 
     std::vector< std::pair<std::string, Ogre::Vector3> > PhysicsSystem::doPhysics (float duration,
@@ -145,6 +165,12 @@ namespace MWWorld
 
     void PhysicsSystem::rotateObject (const std::string& handle, const Ogre::Quaternion& rotation)
     {
+         if (OEngine::Physic::PhysicActor* act = mEngine->getCharacter(handle))
+        {
+            // TODO very dirty hack to avoid crash during setup -> needs cleaning up to allow
+            // start positions others than 0, 0, 0
+            act->setRotation(btQuaternion(rotation.x, rotation.y, rotation.z, rotation.w));
+        }
     }
 
     void PhysicsSystem::scaleObject (const std::string& handle, float scale)
@@ -191,6 +217,7 @@ namespace MWWorld
 
      void PhysicsSystem::insertActorPhysics(const MWWorld::Ptr& ptr, const std::string model){
            Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
+            // std::cout << "Adding node with name" << node->getName();
          addActor (node->getName(), model, node->getPosition());
      }
 
diff --git a/apps/openmw/mwworld/physicssystem.hpp b/apps/openmw/mwworld/physicssystem.hpp
index a447d7bc19..78cbde0837 100644
--- a/apps/openmw/mwworld/physicssystem.hpp
+++ b/apps/openmw/mwworld/physicssystem.hpp
@@ -12,7 +12,7 @@ namespace MWWorld
     class PhysicsSystem
     {
         public:
-            PhysicsSystem (OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng);
+            PhysicsSystem (OEngine::Render::OgreRenderer &_rend);
             ~PhysicsSystem ();
 
             std::vector< std::pair<std::string, Ogre::Vector3> > doPhysics (float duration,
@@ -33,11 +33,17 @@ namespace MWWorld
             void scaleObject (const std::string& handle, float scale);
 
             bool toggleCollisionMode();
-			 std::pair<std::string, float> getFacedHandle (MWWorld::World& world);
+            
+            std::pair<std::string, float> getFacedHandle (MWWorld::World& world);
+            
+            // cast ray, return true if it hit something
+            bool castRay(const Ogre::Vector3& from, const Ogre::Vector3& to);
 
             void insertObjectPhysics(const MWWorld::Ptr& ptr, std::string model);
 
-              void insertActorPhysics(const MWWorld::Ptr&, std::string model);
+            void insertActorPhysics(const MWWorld::Ptr&, std::string model);
+
+            OEngine::Physic::PhysicEngine* getEngine();
 
         private:
             OEngine::Render::OgreRenderer &mRender;
diff --git a/apps/openmw/mwworld/player.cpp b/apps/openmw/mwworld/player.cpp
index 4eb41ebf5c..5bfb82138c 100644
--- a/apps/openmw/mwworld/player.cpp
+++ b/apps/openmw/mwworld/player.cpp
@@ -3,6 +3,8 @@
 
 #include "../mwrender/player.hpp"
 
+#include "../mwmechanics/movement.hpp"
+
 #include "world.hpp"
 #include "class.hpp"
 
diff --git a/apps/openmw/mwworld/ptr.hpp b/apps/openmw/mwworld/ptr.hpp
index 8bf75aa3cb..389c9349d5 100644
--- a/apps/openmw/mwworld/ptr.hpp
+++ b/apps/openmw/mwworld/ptr.hpp
@@ -5,6 +5,8 @@
 
 #include <boost/any.hpp>
 
+#include <components/esm/loadcell.hpp>
+
 #include <components/esm_store/cell_store.hpp>
 
 #include "refdata.hpp"
diff --git a/apps/openmw/mwworld/refdata.cpp b/apps/openmw/mwworld/refdata.cpp
new file mode 100644
index 0000000000..528f49c33e
--- /dev/null
+++ b/apps/openmw/mwworld/refdata.cpp
@@ -0,0 +1,144 @@
+
+#include "refdata.hpp"
+
+#include <components/esm_store/cell_store.hpp>
+
+#include "customdata.hpp"
+
+namespace MWWorld
+{
+    void RefData::copy (const RefData& refData)
+    {
+        mBaseNode = refData.mBaseNode;
+        mLocals = refData.mLocals;
+        mHasLocals = refData.mHasLocals;
+        mEnabled = refData.mEnabled;
+        mCount = refData.mCount;
+        mPosition = refData.mPosition;
+
+        mCustomData = refData.mCustomData ? refData.mCustomData->clone() : 0;
+    }
+
+    void RefData::cleanup()
+    {
+        mBaseNode = 0;
+
+        delete mCustomData;
+        mCustomData = 0;
+    }
+
+    RefData::RefData (const ESM::CellRef& cellRef)
+    : mBaseNode(0), mHasLocals (false), mEnabled (true), mCount (1), mPosition (cellRef.pos),
+      mCustomData (0)
+    {}
+
+    RefData::RefData (const RefData& refData)
+    : mBaseNode(0), mCustomData (0)
+    {
+        try
+        {
+            copy (refData);
+        }
+        catch (...)
+        {
+            cleanup();
+            throw;
+        }
+    }
+
+    RefData& RefData::operator= (const RefData& refData)
+    {
+        try
+        {
+            cleanup();
+            copy (refData);
+        }
+        catch (...)
+        {
+            cleanup();
+            throw;
+        }
+
+        return *this;
+    }
+
+    RefData::~RefData()
+    {
+        try
+        {
+            cleanup();
+        }
+        catch (...)
+        {}
+    }
+
+    std::string RefData::getHandle()
+    {
+        return mBaseNode->getName();
+    }
+
+    Ogre::SceneNode* RefData::getBaseNode()
+    {
+        return mBaseNode;
+    }
+
+    void RefData::setBaseNode(Ogre::SceneNode* base)
+    {
+         mBaseNode = base;
+    }
+
+    int RefData::getCount() const
+    {
+        return mCount;
+    }
+
+    void RefData::setLocals (const ESM::Script& script)
+    {
+        if (!mHasLocals)
+        {
+            mLocals.configure (script);
+            mHasLocals = true;
+        }
+    }
+
+    void RefData::setCount (int count)
+    {
+        mCount = count;
+    }
+
+    MWScript::Locals& RefData::getLocals()
+    {
+        return mLocals;
+    }
+
+    bool RefData::isEnabled() const
+    {
+        return mEnabled;
+    }
+
+    void RefData::enable()
+    {
+        mEnabled = true;
+    }
+
+    void RefData::disable()
+    {
+        mEnabled = true;
+    }
+
+    ESM::Position& RefData::getPosition()
+    {
+        return mPosition;
+    }
+
+    void RefData::setCustomData (CustomData *data)
+    {
+        delete mCustomData;
+        mCustomData = data;
+    }
+
+    CustomData *RefData::getCustomData()
+    {
+        return mCustomData;
+    }
+}
diff --git a/apps/openmw/mwworld/refdata.hpp b/apps/openmw/mwworld/refdata.hpp
index 9a91a27b56..30d676f130 100644
--- a/apps/openmw/mwworld/refdata.hpp
+++ b/apps/openmw/mwworld/refdata.hpp
@@ -3,24 +3,22 @@
 
 #include <string>
 
-#include <boost/shared_ptr.hpp>
+#include <Ogre.h>
+
+#include <components/esm/defs.hpp>
 
 #include "../mwscript/locals.hpp"
 
-#include "../mwmechanics/creaturestats.hpp"
-#include "../mwmechanics/npcstats.hpp"
-#include "../mwmechanics/movement.hpp"
-
-#include "containerstore.hpp"
-#include <Ogre.h>
-
 namespace ESM
 {
     class Script;
+    class CellRef;
 }
 
 namespace MWWorld
 {
+    class CustomData;
+
     class RefData
     {
             Ogre::SceneNode* mBaseNode;
@@ -33,102 +31,58 @@ namespace MWWorld
             bool mEnabled;
             int mCount; // 0: deleted
 
-            // we are using shared pointer here to avoid having to create custom copy-constructor,
-            // assignment operator and destructor. As a consequence though copying a RefData object
-            // manually will probably give unexcepted results. This is not a problem since RefData
-            // are never copied outside of container operations.
-            boost::shared_ptr<MWMechanics::CreatureStats> mCreatureStats;
-            boost::shared_ptr<MWMechanics::NpcStats> mNpcStats;
-            boost::shared_ptr<MWMechanics::Movement> mMovement;
-
-            boost::shared_ptr<ContainerStore<RefData> > mContainerStore;
-
             ESM::Position mPosition;
 
+            CustomData *mCustomData;
+
+            void copy (const RefData& refData);
+
+            void cleanup();
 
         public:
-            /// @param cr Used to copy constant data such as position into this class where it can
-            ///           be altered without effecting the original data. This makes it possible
-            ///           to reset the position as the orignal data is still held in the CellRef
-            RefData(const ESMS::CellRef& cr) : mBaseNode(0), mHasLocals (false), mEnabled (true),
-                                         mCount (1), mPosition(cr.pos) {}
 
+            /// @param cellRef Used to copy constant data such as position into this class where it can
+            /// be altered without effecting the original data. This makes it possible
+            /// to reset the position as the orignal data is still held in the CellRef
+            RefData (const ESM::CellRef& cellRef);
 
-            std::string getHandle()
-            {
-                return mBaseNode->getName();
-            }
-            Ogre::SceneNode* getBaseNode(){
-                return mBaseNode;
-            }
-            void setBaseNode(Ogre::SceneNode* base){
-                 mBaseNode = base;
-            }
+            RefData (const RefData& refData);
 
-            int getCount() const
-            {
-                return mCount;
-            }
+            ~RefData();
 
-            void setLocals (const ESM::Script& script)
-            {
-                if (!mHasLocals)
-                {
-                    mLocals.configure (script);
-                    mHasLocals = true;
-                }
-            }
+            RefData& operator= (const RefData& refData);
 
+            /// Return OGRE handle (may be empty).
+            std::string getHandle();
 
-            void setCount (int count)
-            {
-                mCount = count;
-            }
+            /// Return OGRE base node (can be a null pointer).
+            Ogre::SceneNode* getBaseNode();
 
-            MWScript::Locals& getLocals()
-            {
-                return mLocals;
-            }
+            /// Set OGRE base node (can be a null pointer).
+            void setBaseNode (Ogre::SceneNode* base);
 
-            bool isEnabled() const
-            {
-                return mEnabled;
-            }
+            int getCount() const;
 
-            void enable()
-            {
-                mEnabled = true;
-            }
+            void setLocals (const ESM::Script& script);
 
-            void disable()
-            {
-                mEnabled = true;
-            }
+            void setCount (int count);
 
-            boost::shared_ptr<MWMechanics::CreatureStats>& getCreatureStats()
-            {
-                return mCreatureStats;
-            }
+            MWScript::Locals& getLocals();
 
-            boost::shared_ptr<MWMechanics::NpcStats>& getNpcStats()
-            {
-                return mNpcStats;
-            }
+            bool isEnabled() const;
 
-            boost::shared_ptr<MWMechanics::Movement>& getMovement()
-            {
-                return mMovement;
-            }
+            void enable();
 
-            boost::shared_ptr<ContainerStore<RefData> >& getContainerStore()
-            {
-                return mContainerStore;
-            }
+            void disable();
 
-            ESM::Position& getPosition()
-            {
-                return mPosition;
-            }
+            ESM::Position& getPosition();
+
+            void setCustomData (CustomData *data);
+            ///< Set custom data (potentially replacing old custom data). The ownership of \æ data is
+            /// transferred to this.
+
+            CustomData *getCustomData();
+            ///< May return a 0-pointer. The ownership of the return data object is not transferred.
     };
 }
 
diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp
index 2f9a5185a0..47d5f1a2de 100644
--- a/apps/openmw/mwworld/scene.cpp
+++ b/apps/openmw/mwworld/scene.cpp
@@ -52,16 +52,20 @@ void insertCellRefList(MWRender::RenderingManager& rendering, MWWorld::Environme
 
 namespace MWWorld
 {
-
+    void Scene::update (float duration){
+        mRendering.update (duration);
+    }
     void Scene::unloadCell (CellStoreCollection::iterator iter)
     {
-
+        std::cout << "Unloading cell\n";
         ListHandles functor;
 
-        MWWorld::Ptr::CellStore* active = *iter;
-        mRendering.removeCell(active);
 
-        active->forEach<ListHandles>(functor);
+
+
+
+
+        (*iter)->forEach<ListHandles>(functor);
 
         {
 
@@ -73,10 +77,15 @@ namespace MWWorld
                 mPhysics->removeObject (node->getName());
             }
         }
-        mWorld->getLocalScripts().clearCell (active);
-        mEnvironment.mMechanicsManager->dropActors (active);
-        mEnvironment.mSoundManager->stopSound (active);
-        mActiveCells.erase (iter);
+		mRendering.removeCell(*iter);
+		//mPhysics->removeObject("Unnamed_43");
+
+        mWorld->getLocalScripts().clearCell (*iter);
+        mEnvironment.mMechanicsManager->dropActors (*iter);
+        mEnvironment.mSoundManager->stopSound (*iter);
+		mActiveCells.erase(*iter);
+        
+        
     }
 
     void Scene::loadCell (Ptr::CellStore *cell)
@@ -226,6 +235,9 @@ namespace MWWorld
         // adjust player
         mCurrentCell = cell;
         playerCellChange (cell, position);
+        
+        // adjust fog
+        mRendering.configureFog(*cell);
 
         // Sky system
         mWorld->adjustSky();
diff --git a/apps/openmw/mwworld/scene.hpp b/apps/openmw/mwworld/scene.hpp
index 1ddabb57b4..4d1bd6fb51 100644
--- a/apps/openmw/mwworld/scene.hpp
+++ b/apps/openmw/mwworld/scene.hpp
@@ -101,6 +101,8 @@ namespace MWWorld
             void markCellAsUnchanged();
 
             void insertCell(ESMS::CellStore<MWWorld::RefData> &cell, MWWorld::Environment& environment);
+
+            void update (float duration);
     };
 }
 
diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp
new file mode 100644
index 0000000000..7cb9f3dfc6
--- /dev/null
+++ b/apps/openmw/mwworld/weather.cpp
@@ -0,0 +1,803 @@
+#include "weather.hpp"
+#include "world.hpp"
+#include "player.hpp"
+
+#include "../mwrender/renderingmanager.hpp"
+#include "../mwsound/soundmanager.hpp"
+
+#include <ctime>
+#include <cstdlib>
+#include <iostream>
+
+#include <boost/algorithm/string.hpp>   
+
+using namespace Ogre;
+using namespace MWWorld;
+using namespace MWSound;
+
+#define lerp(x, y) (x * (1-factor) + y * factor)
+
+const std::string WeatherGlobals::mThunderSoundID0 = "Thunder0";
+const std::string WeatherGlobals::mThunderSoundID1 = "Thunder1";
+const std::string WeatherGlobals::mThunderSoundID2 = "Thunder2";
+const std::string WeatherGlobals::mThunderSoundID3 = "Thunder3";
+
+WeatherManager::WeatherManager(MWRender::RenderingManager* rendering, Environment* env) : 
+     mHour(14), mCurrentWeather("clear"), mFirstUpdate(true), mWeatherUpdateTime(0),
+     mThunderFlash(0), mThunderChance(0), mThunderChanceNeeded(50), mThunderSoundDelay(0)
+{
+    mRendering = rendering;
+    mEnvironment = env;
+    
+    #define clr(r,g,b) ColourValue(r/255.f, g/255.f, b/255.f)
+    
+    /// \todo read these from Morrowind.ini
+    Weather clear;
+    clear.mCloudTexture = "tx_sky_clear.dds";
+    clear.mCloudsMaximumPercent = 1.0;
+    clear.mTransitionDelta = 0.015;
+    clear.mSkySunriseColor = clr(118, 141, 164);
+    clear.mSkyDayColor = clr(95, 135, 203);
+    clear.mSkySunsetColor = clr(56, 89, 129);
+    clear.mSkyNightColor = clr(9, 10, 11);
+    clear.mFogSunriseColor = clr(255, 189, 157);
+    clear.mFogDayColor = clr(206, 227, 255);
+    clear.mFogSunsetColor = clr(255, 189, 157);
+    clear.mFogNightColor = clr(9, 10, 11);
+    clear.mAmbientSunriseColor = clr(47, 66, 96);
+    clear.mAmbientDayColor = clr(137, 140, 160);
+    clear.mAmbientSunsetColor = clr(68, 75, 96);
+    clear.mAmbientNightColor = clr(32, 35, 42);
+    clear.mSunSunriseColor = clr(242, 159, 99);
+    clear.mSunDayColor = clr(255, 252, 238);
+    clear.mSunSunsetColor = clr(255, 115, 79);
+    clear.mSunNightColor = clr(59, 97, 176);
+    clear.mSunDiscSunsetColor = clr(255, 189, 157);
+    clear.mLandFogDayDepth = 0.69;
+    clear.mLandFogNightDepth = 0.69;
+    clear.mWindSpeed = 0.1;
+    clear.mCloudSpeed = 1.25;
+    clear.mGlareView = 1.0;
+    mWeatherSettings["clear"] = clear;
+    
+    Weather cloudy;
+    cloudy.mCloudTexture = "tx_sky_cloudy.dds";
+    cloudy.mCloudsMaximumPercent = 1.0;
+    cloudy.mTransitionDelta = 0.015;
+    cloudy.mSkySunriseColor = clr(126, 158, 173);
+    cloudy.mSkyDayColor = clr(117, 160, 215);
+    cloudy.mSkySunsetColor = clr(111, 114, 159);
+    cloudy.mSkyNightColor = clr(9, 10, 11);
+    cloudy.mFogSunriseColor = clr(255, 207, 149);
+    cloudy.mFogDayColor = clr(245, 235, 224);
+    cloudy.mFogSunsetColor = clr(255, 155, 106);
+    cloudy.mFogNightColor = clr(9, 10, 11);
+    cloudy.mAmbientSunriseColor = clr(66, 74, 87);
+    cloudy.mAmbientDayColor = clr(137, 145, 160);
+    cloudy.mAmbientSunsetColor = clr(71, 80, 92);
+    cloudy.mAmbientNightColor = clr(32, 39, 54);
+    cloudy.mSunSunriseColor = clr(241, 177, 99);
+    cloudy.mSunDayColor = clr(255, 236, 221);
+    cloudy.mSunSunsetColor = clr(255, 89, 00);
+    cloudy.mSunNightColor = clr(77, 91, 124);
+    cloudy.mSunDiscSunsetColor = clr(255, 202, 179);
+    cloudy.mLandFogDayDepth = 0.72;
+    cloudy.mLandFogNightDepth = 0.72;
+    cloudy.mWindSpeed = 0.2;
+    cloudy.mCloudSpeed = 2;
+    cloudy.mGlareView = 1.0;
+    mWeatherSettings["cloudy"] = cloudy;
+    
+    Weather foggy;
+    foggy.mCloudTexture = "tx_sky_foggy.dds";
+    foggy.mCloudsMaximumPercent = 1.0;
+    foggy.mTransitionDelta = 0.015;
+    foggy.mSkySunriseColor = clr(197, 190, 180);
+    foggy.mSkyDayColor = clr(184, 211, 228);
+    foggy.mSkySunsetColor = clr(142, 159, 176);
+    foggy.mSkyNightColor = clr(18, 23, 28);
+    foggy.mFogSunriseColor = clr(173, 164, 148);
+    foggy.mFogDayColor = clr(150, 187, 209);
+    foggy.mFogSunsetColor = clr(113, 135, 157);
+    foggy.mFogNightColor = clr(19, 24, 29);
+    foggy.mAmbientSunriseColor = clr(48, 43, 37);
+    foggy.mAmbientDayColor = clr(92, 109, 120);
+    foggy.mAmbientSunsetColor = clr(28, 33, 39);
+    foggy.mAmbientNightColor = clr(28, 33, 39);
+    foggy.mSunSunriseColor = clr(177, 162, 137);
+    foggy.mSunDayColor = clr(111, 131, 151);
+    foggy.mSunSunsetColor = clr(125, 157, 189);
+    foggy.mSunNightColor = clr(81, 100, 119);
+    foggy.mSunDiscSunsetColor = clr(223, 223, 223);
+    foggy.mLandFogDayDepth = 1.0;
+    foggy.mLandFogNightDepth = 1.9;
+    foggy.mWindSpeed = 0;
+    foggy.mCloudSpeed = 1.25;
+    foggy.mGlareView = 0.25;
+    mWeatherSettings["foggy"] = foggy;
+    
+    Weather thunderstorm;
+    thunderstorm.mCloudTexture = "tx_sky_thunder.dds";
+    thunderstorm.mCloudsMaximumPercent = 0.66;
+    thunderstorm.mTransitionDelta = 0.03;
+    thunderstorm.mSkySunriseColor = clr(35, 36, 39);
+    thunderstorm.mSkyDayColor = clr(97, 104, 115);
+    thunderstorm.mSkySunsetColor = clr(35, 36, 39);
+    thunderstorm.mSkyNightColor = clr(19, 20, 22);
+    thunderstorm.mFogSunriseColor = clr(70, 74, 85);
+    thunderstorm.mFogDayColor = clr(97, 104, 115);
+    thunderstorm.mFogSunsetColor = clr(70, 74, 85);
+    thunderstorm.mFogNightColor = clr(19, 20, 22);
+    thunderstorm.mAmbientSunriseColor = clr(54, 54, 54);
+    thunderstorm.mAmbientDayColor = clr(90, 90, 90);
+    thunderstorm.mAmbientSunsetColor = clr(54, 54, 54);
+    thunderstorm.mAmbientNightColor = clr(49, 51, 54);
+    thunderstorm.mSunSunriseColor = clr(91, 99, 122);
+    thunderstorm.mSunDayColor = clr(138, 144, 155);
+    thunderstorm.mSunSunsetColor = clr(96, 101, 117);
+    thunderstorm.mSunNightColor = clr(55, 76, 110);
+    thunderstorm.mSunDiscSunsetColor = clr(128, 128, 128);
+    thunderstorm.mLandFogDayDepth = 1;
+    thunderstorm.mLandFogNightDepth = 1.15;
+    thunderstorm.mWindSpeed = 0.5;
+    thunderstorm.mCloudSpeed = 3;
+    thunderstorm.mGlareView = 0;
+    thunderstorm.mRainLoopSoundID = "rain heavy";
+    mWeatherSettings["thunderstorm"] = thunderstorm;
+    
+    Weather rain;
+    rain.mCloudTexture = "tx_sky_rainy.dds";
+    rain.mCloudsMaximumPercent = 0.66;
+    rain.mTransitionDelta = 0.015;
+    rain.mSkySunriseColor = clr(71, 74, 75);
+    rain.mSkyDayColor = clr(116, 120, 122);
+    rain.mSkySunsetColor = clr(73, 73, 73);
+    rain.mSkyNightColor = clr(24, 25, 26);
+    rain.mFogSunriseColor = clr(71, 74, 75);
+    rain.mFogDayColor = clr(116, 120, 122);
+    rain.mFogSunsetColor = clr(73, 73, 73);
+    rain.mFogNightColor = clr(24, 25, 26);
+    rain.mAmbientSunriseColor = clr(97, 90, 88);
+    rain.mAmbientDayColor = clr(105, 110, 113);
+    rain.mAmbientSunsetColor = clr(88, 97, 97);
+    rain.mAmbientNightColor = clr(50, 55, 67);
+    rain.mSunSunriseColor = clr(131, 122, 120);
+    rain.mSunDayColor = clr(149, 157, 170);
+    rain.mSunSunsetColor = clr(120, 126, 131);
+    rain.mSunNightColor = clr(50, 62, 101);
+    rain.mSunDiscSunsetColor = clr(128, 128, 128);
+    rain.mLandFogDayDepth = 0.8;
+    rain.mLandFogNightDepth = 0.8;
+    rain.mWindSpeed = 0.3;
+    rain.mCloudSpeed = 2;
+    rain.mGlareView = 0;
+    rain.mRainLoopSoundID = "rain";
+    mWeatherSettings["rain"] = rain;
+    
+    Weather overcast;
+    overcast.mCloudTexture = "tx_sky_overcast.dds";
+    overcast.mCloudsMaximumPercent = 1.0;
+    overcast.mTransitionDelta = 0.015;
+    overcast.mSkySunriseColor = clr(91, 99, 106);
+    overcast.mSkyDayColor = clr(143, 146, 149);
+    overcast.mSkySunsetColor = clr(108, 115, 121);
+    overcast.mSkyNightColor = clr(19, 22, 25);
+    overcast.mFogSunriseColor = clr(91, 99, 106);
+    overcast.mFogDayColor = clr(143, 146, 149);
+    overcast.mFogSunsetColor = clr(108, 115, 121);
+    overcast.mFogNightColor = clr(19, 22, 25);
+    overcast.mAmbientSunriseColor = clr(84, 88, 92);
+    overcast.mAmbientDayColor = clr(93, 96, 105);
+    overcast.mAmbientSunsetColor = clr(83, 77, 75);
+    overcast.mAmbientNightColor = clr(57, 60, 66);
+    overcast.mSunSunriseColor = clr(87, 125, 163);
+    overcast.mSunDayColor = clr(163, 169, 183);
+    overcast.mSunSunsetColor = clr(85, 103, 157);
+    overcast.mSunNightColor = clr(32, 54, 100);
+    overcast.mSunDiscSunsetColor = clr(128, 128, 128);
+    overcast.mLandFogDayDepth = 0.7;
+    overcast.mLandFogNightDepth = 0.7;
+    overcast.mWindSpeed = 0.2;
+    overcast.mCloudSpeed = 1.5;
+    overcast.mGlareView = 0;
+    mWeatherSettings["overcast"] = overcast;
+    
+    Weather ashstorm;
+    ashstorm.mCloudTexture = "tx_sky_ashstorm.dds";
+    ashstorm.mCloudsMaximumPercent = 1.0;
+    ashstorm.mTransitionDelta = 0.035;
+    ashstorm.mSkySunriseColor = clr(91, 56, 51);
+    ashstorm.mSkyDayColor = clr(124, 73, 58);
+    ashstorm.mSkySunsetColor = clr(106, 55, 40);
+    ashstorm.mSkyNightColor = clr(20, 21, 22);
+    ashstorm.mFogSunriseColor = clr(91, 56, 51);
+    ashstorm.mFogDayColor = clr(124, 73, 58);
+    ashstorm.mFogSunsetColor = clr(106, 55, 40);
+    ashstorm.mFogNightColor = clr(20, 21, 22);
+    ashstorm.mAmbientSunriseColor = clr(52, 42, 37);
+    ashstorm.mAmbientDayColor = clr(75, 49, 41);
+    ashstorm.mAmbientSunsetColor = clr(48, 39, 35);
+    ashstorm.mAmbientNightColor = clr(36, 42, 49);
+    ashstorm.mSunSunriseColor = clr(184, 91, 71);
+    ashstorm.mSunDayColor = clr(228, 139, 114);
+    ashstorm.mSunSunsetColor = clr(185, 86, 57);
+    ashstorm.mSunNightColor = clr(54, 66, 74);
+    ashstorm.mSunDiscSunsetColor = clr(128, 128, 128);
+    ashstorm.mLandFogDayDepth = 1.1;
+    ashstorm.mLandFogNightDepth = 1.2;
+    ashstorm.mWindSpeed = 0.8;
+    ashstorm.mCloudSpeed = 7;
+    ashstorm.mGlareView = 0;
+    ashstorm.mAmbientLoopSoundID = "ashstorm";
+    mWeatherSettings["ashstorm"] = ashstorm;
+    
+    Weather blight;
+    blight.mCloudTexture = "tx_sky_blight.dds";
+    blight.mCloudsMaximumPercent = 1.0;
+    blight.mTransitionDelta = 0.04;
+    blight.mSkySunriseColor = clr(90, 35, 35);
+    blight.mSkyDayColor = clr(90, 35, 35);
+    blight.mSkySunsetColor = clr(92, 33, 33);
+    blight.mSkyNightColor = clr(44, 14, 14);
+    blight.mFogSunriseColor = clr(90, 35, 35);
+    blight.mFogDayColor = clr(128, 19, 19);
+    blight.mFogSunsetColor = clr(92, 33, 33);
+    blight.mFogNightColor = clr(44, 14, 14);
+    blight.mAmbientSunriseColor = clr(61, 40, 40);
+    blight.mAmbientDayColor = clr(79, 54, 54);
+    blight.mAmbientSunsetColor = clr(61, 40, 40);
+    blight.mAmbientNightColor = clr(56, 58, 62);
+    blight.mSunSunriseColor = clr(180, 78, 78);
+    blight.mSunDayColor = clr(224, 84, 84);
+    blight.mSunSunsetColor = clr(180, 78, 78);
+    blight.mSunNightColor = clr(61, 91, 143);
+    blight.mSunDiscSunsetColor = clr(128, 128, 128);
+    blight.mLandFogDayDepth = 1.1;
+    blight.mLandFogNightDepth = 1.2;
+    blight.mWindSpeed = 0.9;
+    blight.mCloudSpeed = 9;
+    blight.mGlareView = 0;
+    blight.mAmbientLoopSoundID = "blight";
+    mWeatherSettings["blight"] = blight;
+    
+    Weather snow;
+    snow.mCloudTexture = "tx_bm_sky_snow.dds";
+    snow.mCloudsMaximumPercent = 1.0;
+    snow.mTransitionDelta = 0.014;
+    snow.mSkySunriseColor = clr(196, 91, 91);
+    snow.mSkyDayColor = clr(153, 158, 166);
+    snow.mSkySunsetColor = clr(96, 115, 134);
+    snow.mSkyNightColor = clr(31, 35, 39);
+    snow.mFogSunriseColor = clr(106, 91, 91);
+    snow.mFogDayColor = clr(153, 158, 166);
+    snow.mFogSunsetColor = clr(96, 115, 134);
+    snow.mFogNightColor = clr(31, 35, 39);
+    snow.mAmbientSunriseColor = clr(92, 84, 84);
+    snow.mAmbientDayColor = clr(93, 96, 105);
+    snow.mAmbientSunsetColor = clr(70, 79, 87);
+    snow.mAmbientNightColor = clr(49, 58, 68);
+    snow.mSunSunriseColor = clr(141, 109, 109);
+    snow.mSunDayColor = clr(163, 169, 183);
+    snow.mSunSunsetColor = clr(101, 121, 141);
+    snow.mSunNightColor = clr(55, 66, 77);
+    snow.mSunDiscSunsetColor = clr(128, 128, 128);
+    snow.mLandFogDayDepth = 1.0;
+    snow.mLandFogNightDepth = 1.2;
+    snow.mWindSpeed = 0;
+    snow.mCloudSpeed = 1.5;
+    snow.mGlareView = 0;
+    mWeatherSettings["snow"] = snow;
+    
+    Weather blizzard;
+    blizzard.mCloudTexture = "tx_bm_sky_blizzard.dds";
+    blizzard.mCloudsMaximumPercent = 1.0;
+    blizzard.mTransitionDelta = 0.030;
+    blizzard.mSkySunriseColor = clr(91, 99, 106);
+    blizzard.mSkyDayColor = clr(121, 133, 145);
+    blizzard.mSkySunsetColor = clr(108, 115, 121);
+    blizzard.mSkyNightColor = clr(27, 29, 31);
+    blizzard.mFogSunriseColor = clr(91, 99, 106);
+    blizzard.mFogDayColor = clr(121, 133, 145);
+    blizzard.mFogSunsetColor = clr(108, 115, 121);
+    blizzard.mFogNightColor = clr(21, 24, 28);
+    blizzard.mAmbientSunriseColor = clr(84, 88, 92);
+    blizzard.mAmbientDayColor = clr(93, 96, 105);
+    blizzard.mAmbientSunsetColor = clr(83, 77, 75);
+    blizzard.mAmbientNightColor = clr(53, 62, 70);
+    blizzard.mSunSunriseColor = clr(114, 128, 146);
+    blizzard.mSunDayColor = clr(163, 169, 183);
+    blizzard.mSunSunsetColor = clr(106, 114, 136);
+    blizzard.mSunNightColor = clr(57, 66, 74);
+    blizzard.mSunDiscSunsetColor = clr(128, 128, 128);
+    blizzard.mLandFogDayDepth = 2.8;
+    blizzard.mLandFogNightDepth = 3.0;
+    blizzard.mWindSpeed = 0.9;
+    blizzard.mCloudSpeed = 7.5;
+    blizzard.mGlareView = 0;
+    blizzard.mAmbientLoopSoundID = "BM Blizzard";
+    mWeatherSettings["blizzard"] = blizzard;
+}
+
+void WeatherManager::setWeather(const String& weather, bool instant)
+{
+    if (instant || mFirstUpdate)
+    {
+        mNextWeather = "";
+        mCurrentWeather = weather;
+        mFirstUpdate = false;
+    }
+    else
+    {
+        if (mNextWeather != "")
+        {
+            // transition more than 50% finished?
+            if (mRemainingTransitionTime/(mWeatherSettings[mCurrentWeather].mTransitionDelta*24.f*60) <= 0.5)
+                mCurrentWeather = mNextWeather;
+        }
+            
+        mNextWeather = weather;
+        mRemainingTransitionTime = mWeatherSettings[mCurrentWeather].mTransitionDelta*24.f*60;
+    }
+}
+
+WeatherResult WeatherManager::getResult(const String& weather)
+{
+    const Weather& current = mWeatherSettings[weather];
+    WeatherResult result;
+    
+    result.mCloudTexture = current.mCloudTexture;
+    result.mCloudBlendFactor = 0;
+    result.mCloudOpacity = current.mCloudsMaximumPercent;
+    result.mWindSpeed = current.mWindSpeed;
+    result.mCloudSpeed = current.mCloudSpeed;
+    result.mGlareView = current.mGlareView;
+    result.mAmbientLoopSoundID = current.mAmbientLoopSoundID;
+    result.mSunColor = current.mSunDiscSunsetColor;
+    
+    const float fade_duration = current.mTransitionDelta * 24.f;
+    
+    result.mNight = (mHour < 6.f+fade_duration || mHour > 20.f-fade_duration);
+    
+    result.mFogDepth = result.mNight ? current.mLandFogNightDepth : current.mLandFogDayDepth;
+    
+    // night
+    if (mHour <= (WeatherGlobals::mSunriseTime-WeatherGlobals::mSunriseDuration)
+        || mHour >= (WeatherGlobals::mSunsetTime+WeatherGlobals::mSunsetDuration))
+    {
+        result.mFogColor = current.mFogNightColor;
+        result.mAmbientColor = current.mAmbientNightColor;
+        result.mSunColor = current.mSunNightColor;
+        result.mSkyColor = current.mSkyNightColor;
+        result.mNightFade = 1.f;
+    }
+    
+    // sunrise
+    else if (mHour >= (WeatherGlobals::mSunriseTime-WeatherGlobals::mSunriseDuration) && mHour <= WeatherGlobals::mSunriseTime)
+    {
+        if (mHour <= (WeatherGlobals::mSunriseTime-WeatherGlobals::mSunriseDuration+fade_duration))
+        {
+            // fade in
+            float advance = (WeatherGlobals::mSunriseTime-WeatherGlobals::mSunriseDuration+fade_duration)-mHour;
+            float factor = (advance / fade_duration);
+            result.mFogColor = lerp(current.mFogSunriseColor, current.mFogNightColor);
+            result.mAmbientColor = lerp(current.mAmbientSunriseColor, current.mAmbientNightColor);
+            result.mSunColor = lerp(current.mSunSunriseColor, current.mSunNightColor);
+            result.mSkyColor = lerp(current.mSkySunriseColor, current.mSkyNightColor);
+            result.mNightFade = factor;
+        }
+        else if (mHour >= (WeatherGlobals::mSunriseTime-fade_duration))
+        {
+            // fade out
+            float advance = mHour-(WeatherGlobals::mSunriseTime-fade_duration);
+            float factor = advance / fade_duration;
+            result.mFogColor = lerp(current.mFogSunriseColor, current.mFogDayColor);
+            result.mAmbientColor = lerp(current.mAmbientSunriseColor, current.mAmbientDayColor);
+            result.mSunColor = lerp(current.mSunSunriseColor, current.mSunDayColor);
+            result.mSkyColor = lerp(current.mSkySunriseColor, current.mSkyDayColor);
+        }
+        else 
+        {
+            result.mFogColor = current.mFogSunriseColor;
+            result.mAmbientColor = current.mAmbientSunriseColor;
+            result.mSunColor = current.mSunSunriseColor;
+            result.mSkyColor = current.mSkySunriseColor;
+        }
+    }
+    
+    // day
+    else if (mHour >= (WeatherGlobals::mSunriseTime) && mHour <= (WeatherGlobals::mSunsetTime))
+    {
+        result.mFogColor = current.mFogDayColor;
+        result.mAmbientColor = current.mAmbientDayColor;
+        result.mSunColor = current.mSunDayColor;
+        result.mSkyColor = current.mSkyDayColor;
+    }
+    
+    // sunset
+    else if (mHour >= (WeatherGlobals::mSunsetTime) && mHour <= (WeatherGlobals::mSunsetTime+WeatherGlobals::mSunsetDuration))
+    {
+        if (mHour <= (WeatherGlobals::mSunsetTime+fade_duration))
+        {
+            // fade in
+            float advance = (WeatherGlobals::mSunsetTime+fade_duration)-mHour;
+            float factor = (advance / fade_duration);
+            result.mFogColor = lerp(current.mFogSunsetColor, current.mFogDayColor);
+            result.mAmbientColor = lerp(current.mAmbientSunsetColor, current.mAmbientDayColor);
+            result.mSunColor = lerp(current.mSunSunsetColor, current.mSunDayColor);
+            result.mSkyColor = lerp(current.mSkySunsetColor, current.mSkyDayColor);
+        }
+        else if (mHour >= (WeatherGlobals::mSunsetTime+WeatherGlobals::mSunsetDuration-fade_duration))
+        {
+            // fade out
+            float advance = mHour-(WeatherGlobals::mSunsetTime+WeatherGlobals::mSunsetDuration-fade_duration);
+            float factor = advance / fade_duration;
+            result.mFogColor = lerp(current.mFogSunsetColor, current.mFogNightColor);
+            result.mAmbientColor = lerp(current.mAmbientSunsetColor, current.mAmbientNightColor);
+            result.mSunColor = lerp(current.mSunSunsetColor, current.mSunNightColor);
+            result.mSkyColor = lerp(current.mSkySunsetColor, current.mSkyNightColor);
+            result.mNightFade = factor;
+        }
+        else 
+        {
+            result.mFogColor = current.mFogSunsetColor;
+            result.mAmbientColor = current.mAmbientSunsetColor;
+            result.mSunColor = current.mSunSunsetColor;
+            result.mSkyColor = current.mSkySunsetColor;
+        }
+    }
+    
+    return result;
+}
+
+WeatherResult WeatherManager::transition(float factor)
+{
+    const WeatherResult& current = getResult(mCurrentWeather);
+    const WeatherResult& other = getResult(mNextWeather);
+    WeatherResult result;
+    
+    result.mCloudTexture = current.mCloudTexture;
+    result.mNextCloudTexture = other.mCloudTexture;
+    result.mCloudBlendFactor = factor;
+    
+    result.mCloudOpacity = lerp(current.mCloudOpacity, other.mCloudOpacity);
+    result.mFogColor = lerp(current.mFogColor, other.mFogColor);
+    result.mSunColor = lerp(current.mSunColor, other.mSunColor);
+    result.mSkyColor = lerp(current.mSkyColor, other.mSkyColor);
+    
+    result.mAmbientColor = lerp(current.mAmbientColor, other.mAmbientColor);
+    result.mSunDiscColor = lerp(current.mSunDiscColor, other.mSunDiscColor);
+    result.mFogDepth = lerp(current.mFogDepth, other.mFogDepth);
+    result.mWindSpeed = lerp(current.mWindSpeed, other.mWindSpeed);
+    result.mCloudSpeed = lerp(current.mCloudSpeed, other.mCloudSpeed);
+    result.mCloudOpacity = lerp(current.mCloudOpacity, other.mCloudOpacity);
+    result.mGlareView = lerp(current.mGlareView, other.mGlareView);
+    
+    result.mNight = current.mNight;
+    
+    // sound change behaviour:
+    // if 'other' has a new sound, switch to it after 1/2 of the transition length
+    if (other.mAmbientLoopSoundID != "")
+        result.mAmbientLoopSoundID = factor>0.5 ? other.mAmbientLoopSoundID : current.mAmbientLoopSoundID;
+    // if 'current' has a sound and 'other' does not have a sound, turn off the sound immediately
+    else if (current.mAmbientLoopSoundID != "")
+        result.mAmbientLoopSoundID = "";
+        
+    return result;
+}
+
+void WeatherManager::update(float duration)
+{
+    mWeatherUpdateTime -= duration;
+    if (mEnvironment->mWorld->isCellExterior() || mEnvironment->mWorld->isCellQuasiExterior())
+    {
+        std::string regionstr = mEnvironment->mWorld->getPlayer().getPlayer().getCell()->cell->region;
+        boost::algorithm::to_lower(regionstr);
+        
+        if (mWeatherUpdateTime <= 0 || regionstr != mCurrentRegion)
+        {
+            mCurrentRegion = regionstr;
+            mWeatherUpdateTime = WeatherGlobals::mWeatherUpdateTime*60.f;
+            
+            std::string weather;
+            
+            if (mRegionOverrides.find(regionstr) != mRegionOverrides.end())
+                weather = mRegionOverrides[regionstr];
+            else
+            {
+                // get weather probabilities for the current region
+                const ESM::Region *region = mEnvironment->mWorld->getStore().regions.find (regionstr);
+                
+                float clear = region->data.clear/255.f;
+                float cloudy = region->data.cloudy/255.f;
+                float foggy = region->data.foggy/255.f;
+                float overcast = region->data.overcast/255.f;
+                float rain = region->data.rain/255.f;
+                float thunder = region->data.thunder/255.f;
+                float ash = region->data.ash/255.f;
+                float blight = region->data.blight/255.f;
+                float snow = region->data.a/255.f;
+                float blizzard = region->data.b/255.f;
+                
+                // re-scale to 100 percent
+                const float total = clear+cloudy+foggy+overcast+rain+thunder+ash+blight+snow+blizzard;
+                            
+                srand(time(NULL));
+                float random = ((rand()%100)/100.f) * total;
+                                
+                if (random >= snow+blight+ash+thunder+rain+overcast+foggy+cloudy+clear)
+                    weather = "blizzard";
+                else if (random >= blight+ash+thunder+rain+overcast+foggy+cloudy+clear)
+                    weather = "snow";
+                else if (random >= ash+thunder+rain+overcast+foggy+cloudy+clear)
+                    weather = "blight";
+                else if (random >= thunder+rain+overcast+foggy+cloudy+clear)
+                    weather = "ashstorm";
+                else if (random >= rain+overcast+foggy+cloudy+clear)
+                    weather = "thunderstorm";
+                else if (random >= overcast+foggy+cloudy+clear)
+                    weather = "rain";
+                else if (random >= foggy+cloudy+clear)
+                    weather = "overcast";
+                else if (random >= cloudy+clear)
+                    weather = "foggy";
+                else if (random >= clear)
+                    weather = "cloudy";
+                else
+                    weather = "clear";
+            }
+            
+            setWeather(weather, false);
+            /*
+            std::cout << "roll result: " << random << std::endl;
+            
+            std::cout << regionstr << " weather probabilities: " << clear << " " << cloudy << " " << foggy << " " 
+                << overcast << " " << rain << " " << thunder << " " << ash << " " << blight << " " << snow << " " 
+                << blizzard << std::endl;
+            
+            std::cout << "New weather : " << weather << std::endl;
+            */
+        }
+                
+        WeatherResult result;
+        
+        if (mNextWeather != "")
+        {
+            mRemainingTransitionTime -= duration;
+            if (mRemainingTransitionTime < 0)
+            {
+                mCurrentWeather = mNextWeather;
+                mNextWeather = "";
+            }
+        }
+        
+        if (mNextWeather != "")
+            result = transition(1-(mRemainingTransitionTime/(mWeatherSettings[mCurrentWeather].mTransitionDelta*24.f*60)));
+        else
+            result = getResult(mCurrentWeather);
+        
+        mRendering->configureFog(result.mFogDepth, result.mFogColor);
+        
+        // disable sun during night
+        if (mHour >= WeatherGlobals::mSunsetTime+WeatherGlobals::mSunsetDuration
+            || mHour <= WeatherGlobals::mSunriseTime-WeatherGlobals::mSunriseDuration)
+            mRendering->getSkyManager()->sunDisable();
+        else
+        {
+            // during day, calculate sun angle
+            float height = 1-std::abs(((mHour-13)/7.f));
+            int facing = mHour > 13.f ? 1 : -1;
+            Vector3 final(
+                (1-height)*facing, 
+                (1-height)*facing, 
+                height);
+            mRendering->setSunDirection(final);
+            
+            mRendering->getSkyManager()->sunEnable();
+        }
+        
+        // moon calculations
+        float night;
+        if (mHour >= 14)
+            night = mHour-14;
+        else if (mHour <= 10)
+            night = mHour+10;
+        else
+            night = 0;
+            
+        night /= 20.f;
+        
+        if (night != 0)
+        {
+            float moonHeight = 1-std::abs((night-0.5)*2);
+            int facing = (mHour > 0.f && mHour<12.f) ? 1 : -1;
+            Vector3 masser(
+                (1-moonHeight)*facing, 
+                (1-moonHeight)*facing, 
+                moonHeight);
+            
+            Vector3 secunda(
+                (1-moonHeight)*facing*0.8, 
+                (1-moonHeight)*facing*1.25, 
+                moonHeight);
+            
+            mRendering->getSkyManager()->setMasserDirection(masser);
+            mRendering->getSkyManager()->setSecundaDirection(secunda);
+            mRendering->getSkyManager()->masserEnable();
+            mRendering->getSkyManager()->secundaEnable();
+            
+            float hour_fade;
+            if (mHour >= 7.f && mHour <= 14.f)
+                hour_fade = 1-(mHour-7)/3.f;
+            else if (mHour >= 14 && mHour <= 15.f)
+                hour_fade = mHour-14;
+            else
+                hour_fade = 1;
+            
+            float secunda_angle_fade;
+            float masser_angle_fade;
+            float angle = moonHeight*90.f;
+            
+            if (angle >= 30 && angle <= 50)
+                secunda_angle_fade = (angle-30)/20.f;
+            else if (angle <30)
+                secunda_angle_fade = 0.f;
+            else
+                secunda_angle_fade = 1.f;
+            
+            if (angle >= 40 && angle <= 50)
+                masser_angle_fade = (angle-40)/10.f;
+            else if (angle <40)
+                masser_angle_fade = 0.f;
+            else
+                masser_angle_fade = 1.f;
+                
+            masser_angle_fade *= hour_fade;
+            secunda_angle_fade *= hour_fade;
+            
+            mRendering->getSkyManager()->setMasserFade(masser_angle_fade);
+            mRendering->getSkyManager()->setSecundaFade(secunda_angle_fade);
+        }
+        else
+        {
+            mRendering->getSkyManager()->masserDisable();
+            mRendering->getSkyManager()->secundaDisable();
+        }
+        
+        if (mCurrentWeather == "thunderstorm" && mNextWeather == "")
+        {
+            if (mThunderFlash > 0)
+            {
+                // play the sound after a delay
+                mThunderSoundDelay -= duration;
+                if (mThunderSoundDelay <= 0)
+                {
+                    // pick a random sound
+                    int sound = rand() % 4;
+                    std::string soundname;
+                    if (sound == 0) soundname = WeatherGlobals::mThunderSoundID0;
+                    else if (sound == 1) soundname = WeatherGlobals::mThunderSoundID1;
+                    else if (sound == 2) soundname = WeatherGlobals::mThunderSoundID2;
+                    else if (sound == 3) soundname = WeatherGlobals::mThunderSoundID3;
+                    mEnvironment->mSoundManager->playSound(soundname, 1.0, 1.0);
+                    mThunderSoundDelay = 1000;
+                }
+                
+                mThunderFlash -= duration;
+                if (mThunderFlash > 0)
+                    mRendering->getSkyManager()->setThunder( mThunderFlash / WeatherGlobals::mThunderThreshold );
+                else
+                {
+                    srand(time(NULL));
+                    mThunderChanceNeeded = rand() % 100;
+                    mThunderChance = 0;
+                    mRendering->getSkyManager()->setThunder( 0.f );
+                }
+            }
+            else
+            {
+                // no thunder active
+                mThunderChance += duration*4; // chance increases by 4 percent every second
+                if (mThunderChance >= mThunderChanceNeeded)
+                {
+                    mThunderFlash = WeatherGlobals::mThunderThreshold;
+                    
+                    mRendering->getSkyManager()->setThunder( mThunderFlash / WeatherGlobals::mThunderThreshold );
+                    
+                    mThunderSoundDelay = WeatherGlobals::mThunderSoundDelay;
+                }
+            }
+        }
+        else
+            mRendering->getSkyManager()->setThunder(0.f);
+        
+        mRendering->setAmbientColour(result.mAmbientColor);
+        mRendering->sunEnable();
+        mRendering->setSunColour(result.mSunColor);
+        
+        mRendering->getSkyManager()->setWeather(result);
+    }
+    else
+    {
+        mRendering->sunDisable();
+        mRendering->skyDisable();
+        mRendering->getSkyManager()->setThunder(0.f);
+    }
+}
+
+void WeatherManager::setHour(const float hour)
+{
+    // accelerate a bit for testing
+    /*
+    mHour += 0.005;
+    
+    if (mHour >= 24.f) mHour = 0.f;
+    
+    std::cout << "hour " << mHour << std::endl;
+    */
+    
+    mHour = hour;
+}
+
+void WeatherManager::setDate(const int day, const int month)
+{
+    mDay = day;
+    mMonth = month;
+}
+
+unsigned int WeatherManager::getWeatherID() const
+{
+    // Source: http://www.uesp.net/wiki/Tes3Mod:GetCurrentWeather
+    
+    if (mCurrentWeather == "clear")
+        return 0;
+    else if (mCurrentWeather == "cloudy")
+        return 1;
+    else if (mCurrentWeather == "foggy")
+        return 2;
+    else if (mCurrentWeather == "overcast")
+        return 3;
+    else if (mCurrentWeather == "rain")
+        return 4;
+    else if (mCurrentWeather == "thunder")
+        return 5;
+    else if (mCurrentWeather == "ashstorm")
+        return 6;
+    else if (mCurrentWeather == "blight")
+        return 7;
+    else if (mCurrentWeather == "snow")
+        return 8;
+    else if (mCurrentWeather == "blizzard")
+        return 9;
+    
+    else
+        return 0;
+}
+
+void WeatherManager::changeWeather(const std::string& region, const unsigned int id)
+{
+    std::string weather;
+    if (id==0)
+        weather = "clear";
+    else if (id==1)
+        weather = "cloudy";
+    else if (id==2)
+        weather = "foggy";
+    else if (id==3)
+        weather = "overcast";
+    else if (id==4)
+        weather = "rain";
+    else if (id==5)
+        weather = "thunder";
+    else if (id==6)
+        weather = "ashstorm";
+    else if (id==7)
+        weather = "blight";
+    else if (id==8)
+        weather = "snow";
+    else if (id==9)
+        weather = "blizzard";
+    else
+        weather = "clear";
+
+    mRegionOverrides[region] = weather;
+}
diff --git a/apps/openmw/mwworld/weather.hpp b/apps/openmw/mwworld/weather.hpp
new file mode 100644
index 0000000000..7a719252b0
--- /dev/null
+++ b/apps/openmw/mwworld/weather.hpp
@@ -0,0 +1,272 @@
+#ifndef GAME_MWWORLD_WEATHER_H
+#define GAME_MWWORLD_WEATHER_H
+
+#include <OgreString.h>
+#include <OgreColourValue.h>
+
+namespace MWRender
+{
+    class RenderingManager;
+}
+
+namespace MWWorld
+{
+    class Environment;
+    
+    /// Global weather manager properties (according to INI)
+    struct WeatherGlobals
+    {
+        /*
+        [Weather]
+        EnvReduceColor=255,255,255,255
+        LerpCloseColor=037,046,048,255
+        BumpFadeColor=230,239,255,255
+        AlphaReduce=0.35
+        Minimum Time Between Environmental Sounds=1.0
+        Maximum Time Between Environmental Sounds=5.0
+        Sun Glare Fader Max=0.5
+        Sun Glare Fader Angle Max=30.0
+        Sun Glare Fader Color=222,095,039
+        Timescale Clouds=0
+        Precip Gravity=575
+        Hours Between Weather Changes=20
+        Rain Ripples=1
+        Rain Ripple Radius=1024
+        Rain Ripples Per Drop=1
+        Rain Ripple Scale=0.3
+        Rain Ripple Speed=1.0
+        Fog Depth Change Speed=3
+        Sunrise Time=6
+        Sunset Time=18
+        Sunrise Duration=2
+        Sunset Duration=2
+        Sky Pre-Sunrise Time=.5
+        Sky Post-Sunrise Time=1
+        Sky Pre-Sunset Time=1.5
+        Sky Post-Sunset Time=.5
+        Ambient Pre-Sunrise Time=.5
+        Ambient Post-Sunrise Time=2
+        Ambient Pre-Sunset Time=1
+        Ambient Post-Sunset Time=1.25
+        Fog Pre-Sunrise Time=.5
+        Fog Post-Sunrise Time=1
+        Fog Pre-Sunset Time=2
+        Fog Post-Sunset Time=1
+        Sun Pre-Sunrise Time=0
+        Sun Post-Sunrise Time=0
+        Sun Pre-Sunset Time=1
+        Sun Post-Sunset Time=1.25
+        Stars Post-Sunset Start=1
+        Stars Pre-Sunrise Finish=2
+        Stars Fading Duration=2
+        Snow Ripples=0
+        Snow Ripple Radius=1024
+        Snow Ripples Per Flake=1
+        Snow Ripple Scale=0.3
+        Snow Ripple Speed=1.0
+        Snow Gravity Scale=0.1
+        Snow High Kill=700
+        Snow Low Kill=150
+        
+        
+        [Moons]
+        Masser Size=94
+        Masser Fade In Start=14
+        Masser Fade In Finish=15
+        Masser Fade Out Start=7
+        Masser Fade Out Finish=10
+        Masser Axis Offset=35
+        Masser Speed=.5
+        Masser Daily Increment=1
+        Masser Fade Start Angle=50
+        Masser Fade End Angle=40
+        Masser Moon Shadow Early Fade Angle=0.5
+        Secunda Size=40
+        Secunda Fade In Start=14
+        Secunda Fade In Finish=15
+        Secunda Fade Out Start=7
+        Secunda Fade Out Finish=10
+        Secunda Axis Offset=50
+        Secunda Speed=.6
+        Secunda Daily Increment=1.2
+        Secunda Fade Start Angle=50
+        Secunda Fade End Angle=30
+        Secunda Moon Shadow Early Fade Angle=0.5
+        Script Color=255,20,20
+        */
+        
+        static const float mSunriseTime = 8;
+        static const float mSunsetTime = 18;
+        static const float mSunriseDuration = 2;
+        static const float mSunsetDuration = 2;
+        
+        static const float mWeatherUpdateTime = 20.f;
+        
+        // morrowind sets these per-weather, but since they are only used by 'thunderstorm'
+        // weather setting anyway, we can just as well set them globally
+        static const float mThunderFrequency = .4;
+        static const float mThunderThreshold = 0.6;
+        static const float mThunderSoundDelay = 0.25;
+        static const std::string mThunderSoundID0;
+        static const std::string mThunderSoundID1;
+        static const std::string mThunderSoundID2;
+        static const std::string mThunderSoundID3;
+    };
+
+    /// Defines the actual weather that results from weather setting (see below), time of day and weather transition
+    struct WeatherResult
+    {
+        Ogre::String mCloudTexture;
+        Ogre::String mNextCloudTexture;
+        float mCloudBlendFactor;
+        
+        Ogre::ColourValue mFogColor;
+        
+        Ogre::ColourValue mAmbientColor;
+        
+        Ogre::ColourValue mSkyColor;
+        
+        Ogre::ColourValue mSunColor;
+        
+        Ogre::ColourValue mSunDiscColor;
+        
+        float mFogDepth;
+        
+        float mWindSpeed;
+        
+        float mCloudSpeed;
+        
+        float mCloudOpacity;
+        
+        float mGlareView;
+        
+        bool mNight; // use night skybox
+        float mNightFade; // fading factor for night skybox
+        
+        Ogre::String mAmbientLoopSoundID;
+    };
+    
+    
+    /// Defines a single weather setting (according to INI)
+    struct Weather
+    {
+        Ogre::String mCloudTexture;
+        
+        // Sky (atmosphere) colors 
+        Ogre::ColourValue   mSkySunriseColor,
+                            mSkyDayColor,
+                            mSkySunsetColor,
+                            mSkyNightColor;
+        
+        // Fog colors
+        Ogre::ColourValue   mFogSunriseColor,
+                            mFogDayColor,
+                            mFogSunsetColor,
+                            mFogNightColor;
+        
+        // Ambient lighting colors
+        Ogre::ColourValue   mAmbientSunriseColor,
+                            mAmbientDayColor,
+                            mAmbientSunsetColor,
+                            mAmbientNightColor;
+        
+        // Sun (directional) lighting colors
+        Ogre::ColourValue   mSunSunriseColor,
+                            mSunDayColor,
+                            mSunSunsetColor,
+                            mSunNightColor;
+        
+        // Fog depth/density
+        float   mLandFogDayDepth,
+                mLandFogNightDepth;
+        
+        // Color modulation for the sun itself during sunset (not completely sure)
+        Ogre::ColourValue mSunDiscSunsetColor;
+        
+        // Duration of weather transition (in days)
+        float mTransitionDelta;
+        
+        // No idea what this one is used for?
+        float mWindSpeed;
+        
+        // Cloud animation speed multiplier
+        float mCloudSpeed;
+        
+        // Multiplier for clouds transparency
+        float mCloudsMaximumPercent;
+        
+        // Value between 0 and 1, defines the strength of the sun glare effect
+        float mGlareView;
+        
+        // Sound effect
+        // This is used for Blight, Ashstorm and Blizzard (Bloodmoon)
+        Ogre::String mAmbientLoopSoundID;
+        
+        // Rain sound effect
+        Ogre::String mRainLoopSoundID;
+        
+        /// \todo disease chance
+    };
+    
+    ///
+    /// Interface for weather settings
+    ///
+    class WeatherManager
+    {
+    public:
+        WeatherManager(MWRender::RenderingManager*, MWWorld::Environment*);
+        
+        /**
+         * Change the weather in the specified region
+         * @param region that should be changed
+         * @param ID of the weather setting to shift to
+         */
+        void changeWeather(const std::string& region, const unsigned int id);
+        
+        /**
+         * Per-frame update
+         * @param duration
+         */
+        void update(float duration);
+        
+        void setHour(const float hour);
+        
+        void setDate(const int day, const int month);
+        
+        unsigned int getWeatherID() const;
+        
+    private:
+        float mHour;
+        int mDay, mMonth;
+        
+        MWRender::RenderingManager* mRendering;
+        MWWorld::Environment* mEnvironment;
+        
+        std::map<Ogre::String, Weather> mWeatherSettings;
+        
+        std::map<std::string, std::string> mRegionOverrides;
+        
+        Ogre::String mCurrentWeather;
+        Ogre::String mNextWeather;
+        
+        std::string mCurrentRegion;
+        
+        bool mFirstUpdate;
+        
+        float mWeatherUpdateTime;
+        
+        float mRemainingTransitionTime;
+        
+        float mThunderFlash;
+        float mThunderChance;
+        float mThunderChanceNeeded;
+        float mThunderSoundDelay;
+        
+        WeatherResult transition(const float factor);
+        WeatherResult getResult(const Ogre::String& weather);
+        
+        void setWeather(const Ogre::String& weather, bool instant=false);
+    };
+}
+
+#endif // GAME_MWWORLD_WEATHER_H
diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp
index 45f333d9b3..1a69f4d7b4 100644
--- a/apps/openmw/mwworld/world.cpp
+++ b/apps/openmw/mwworld/world.cpp
@@ -13,15 +13,20 @@
 
 #include "../mwsound/soundmanager.hpp"
 
+
 #include "ptr.hpp"
 #include "environment.hpp"
 #include "class.hpp"
 #include "player.hpp"
+#include "weather.hpp"
 
 #include "refdata.hpp"
 #include "globals.hpp"
 #include "cellfunctors.hpp"
 
+#include <OgreVector3.h>
+using namespace Ogre;
+
 namespace
 {
     template<typename T>
@@ -135,24 +140,31 @@ namespace MWWorld
 
     void World::adjustSky()
     {
-        if (mSky)
+        if (mSky && (isCellExterior() || isCellQuasiExterior()))
         {
-            toggleSky();
-            // TODO set weather
-            toggleSky();
+            mRendering->skySetHour (mGlobalVariables->getFloat ("gamehour"));
+            mRendering->skySetDate (mGlobalVariables->getInt ("day"),
+                mGlobalVariables->getInt ("month"));
+
+            mRendering->getSkyManager()->enable();
         }
+        else
+            mRendering->getSkyManager()->disable();
     }
 
-    World::World (OEngine::Render::OgreRenderer& renderer, OEngine::Physic::PhysicEngine* physEng,
+    World::World (OEngine::Render::OgreRenderer& renderer,
         const Files::Collections& fileCollections,
         const std::string& master, const boost::filesystem::path& resDir,
         bool newGame, Environment& environment, const std::string& encoding)
-    : mRendering (renderer,resDir, physEng),mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
-      mSky (false), mEnvironment (environment), mNextDynamicRecord (0), mCells (mStore, mEsm, *this)
+    : mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
+      mSky (true), mEnvironment (environment), mNextDynamicRecord (0), mCells (mStore, mEsm, *this)
     {
-        mPhysEngine = physEng;
-
-        mPhysics = new PhysicsSystem(renderer, physEng);
+        mPhysics = new PhysicsSystem(renderer);
+        mPhysEngine = mPhysics->getEngine();
+        
+        mRendering = new MWRender::RenderingManager(renderer, resDir, mPhysEngine, environment);
+        
+        mWeatherManager = new MWWorld::WeatherManager(mRendering, &environment);
 
         boost::filesystem::path masterPath (fileCollections.getCollection (".esm").getPath (master));
 
@@ -163,7 +175,7 @@ namespace MWWorld
         mEsm.open (masterPath.string());
         mStore.load (mEsm);
 
-        MWRender::Player* play = &(mRendering.getPlayer());
+        MWRender::Player* play = &(mRendering->getPlayer());
         mPlayer = new MWWorld::Player (play, mStore.npcs.find ("player"), *this);
         mPhysics->addActor (mPlayer->getPlayer().getRefData().getHandle(), "", Ogre::Vector3 (0, 0, 0));
 
@@ -176,17 +188,17 @@ namespace MWWorld
             mGlobalVariables->setInt ("chargenstate", 1);
         }
 
-        mPhysEngine = physEng;
-
-        mWorldScene = new Scene(environment, this, mRendering, mPhysics);
+        mWorldScene = new Scene(environment, this, *mRendering, mPhysics);
 
     }
 
+
     World::~World()
     {
+        delete mWeatherManager;
         delete mWorldScene;
         delete mGlobalVariables;
-
+        delete mRendering;
         delete mPhysics;
 
         delete mPlayer;
@@ -368,7 +380,9 @@ namespace MWWorld
 
         mGlobalVariables->setFloat ("gamehour", hour);
 
-        mRendering.skySetHour (hour);
+        mRendering->skySetHour (hour);
+        
+        mWeatherManager->setHour (hour);
 
         if (days>0)
             setDay (days + mGlobalVariables->getInt ("day"));
@@ -403,7 +417,11 @@ namespace MWWorld
         mGlobalVariables->setInt ("day", day);
         mGlobalVariables->setInt ("month", month);
 
-        mRendering.skySetDate (day, month);
+        mRendering->skySetDate (day, month);
+        
+        mWeatherManager->setDate (day, month);
+        
+        
     }
 
     void World::setMonth (int month)
@@ -424,7 +442,7 @@ namespace MWWorld
         if (years>0)
             mGlobalVariables->setInt ("year", years+mGlobalVariables->getInt ("year"));
 
-        mRendering.skySetDate (mGlobalVariables->getInt ("day"), month);
+        mRendering->skySetDate (mGlobalVariables->getInt ("day"), month);
     }
 
     bool World::toggleSky()
@@ -432,34 +450,30 @@ namespace MWWorld
         if (mSky)
         {
             mSky = false;
-            mRendering.skyDisable();
+            mRendering->skyDisable();
             return false;
         }
         else
         {
             mSky = true;
-            // TODO check for extorior or interior with sky.
-            mRendering.skySetHour (mGlobalVariables->getFloat ("gamehour"));
-            mRendering.skySetDate (mGlobalVariables->getInt ("day"),
-                mGlobalVariables->getInt ("month"));
-            mRendering.skyEnable();
+            mRendering->skyEnable();
             return true;
         }
     }
 
     int World::getMasserPhase() const
     {
-        return mRendering.skyGetMasserPhase();
+        return mRendering->skyGetMasserPhase();
     }
 
     int World::getSecundaPhase() const
     {
-        return mRendering.skyGetSecundaPhase();
+        return mRendering->skyGetSecundaPhase();
     }
 
     void World::setMoonColour (bool red)
     {
-        mRendering.skySetMoonColour (red);
+        mRendering->skySetMoonColour (red);
     }
 
     float World::getTimeScaleFactor() const
@@ -505,7 +519,7 @@ namespace MWWorld
                             mEnvironment.mSoundManager->stopSound3D (ptr);
 
                             mPhysics->removeObject (ptr.getRefData().getHandle());
-                            mRendering.removeObject(ptr);
+                            mRendering->removeObject(ptr);
 
                             mLocalScripts.remove (ptr);
                 }
@@ -542,7 +556,7 @@ namespace MWWorld
 
         /// \todo cell change for non-player ref
 
-        mRendering.moveObject (ptr, Ogre::Vector3 (x, y, z));
+        mRendering->moveObject (ptr, Ogre::Vector3 (x, y, z));
     }
 
     void World::moveObject (Ptr ptr, float x, float y, float z)
@@ -611,12 +625,12 @@ namespace MWWorld
 
     bool World::toggleCollisionMode()
     {
-        return mPhysics->toggleCollisionMode();
+        return mPhysics->toggleCollisionMode();;
     }
 
     bool World::toggleRenderMode (RenderMode mode)
     {
-        return mRendering.toggleRenderMode (mode);
+        return mRendering->toggleRenderMode (mode);
     }
 
     std::pair<std::string, const ESM::Potion *> World::createRecord (const ESM::Potion& record)
@@ -673,4 +687,71 @@ namespace MWWorld
             return cell;
         }
     }
+
+    void World::playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode,
+        int number)
+    {
+        mRendering->playAnimationGroup (ptr, groupName, mode, number);
+    }
+
+    void World::skipAnimation (const MWWorld::Ptr& ptr)
+    {
+        mRendering->skipAnimation (ptr);
+    }
+
+    void World::update (float duration)
+    {
+        mWorldScene->update (duration);
+        
+        mWeatherManager->update (duration);
+        
+        // cast a ray from player to sun to detect if the sun is visible
+        // this is temporary until we find a better place to put this code
+        // currently its here because we need to access the physics system
+        float* p = mPlayer->getPlayer().getRefData().getPosition().pos;
+        Vector3 sun = mRendering->getSkyManager()->getRealSunPos();
+        sun = Vector3(sun.x, -sun.z, sun.y);
+        mRendering->getSkyManager()->setGlare(!mPhysics->castRay(Ogre::Vector3(p[0], p[1], p[2]), sun));
+    }
+    
+    bool World::isCellExterior() const
+    {
+        Ptr::CellStore *currentCell = mWorldScene->getCurrentCell();
+        if (currentCell)
+        {
+            if (!(currentCell->cell->data.flags & ESM::Cell::Interior))
+                return true;
+            else
+                return false;
+        }
+        return false;
+    }
+    
+    bool World::isCellQuasiExterior() const
+    {
+        Ptr::CellStore *currentCell = mWorldScene->getCurrentCell();
+        if (currentCell)
+        {
+            if (!(currentCell->cell->data.flags & ESM::Cell::QuasiEx))
+                return false;
+            else
+                return true;
+        }
+        return false;
+    }
+    
+    int World::getCurrentWeather() const
+    {
+        return mWeatherManager->getWeatherID();
+    }
+    
+    void World::changeWeather(const std::string& region, const unsigned int id)
+    {
+        mWeatherManager->changeWeather(region, id);
+    }
+    
+    OEngine::Render::Fader* World::getFader()
+    {
+        return mRendering->getFader();
+    }
 }
diff --git a/apps/openmw/mwworld/world.hpp b/apps/openmw/mwworld/world.hpp
index ea775453ac..71cca3545d 100644
--- a/apps/openmw/mwworld/world.hpp
+++ b/apps/openmw/mwworld/world.hpp
@@ -20,6 +20,7 @@
 #include "localscripts.hpp"
 
 #include <openengine/bullet/physic.hpp>
+#include <openengine/ogre/fader.hpp>
 
 namespace Ogre
 {
@@ -49,6 +50,7 @@ namespace MWRender
 
 namespace MWWorld
 {
+    class WeatherManager;
     class Environment;
     class Player;
 
@@ -60,13 +62,16 @@ namespace MWWorld
 
             enum RenderMode
             {
-                Render_CollisionDebug
+                Render_CollisionDebug,
+                Render_Wireframe
             };
 
         private:
 
-            MWRender::RenderingManager mRendering;
+            MWRender::RenderingManager* mRendering;
             
+            MWWorld::WeatherManager* mWeatherManager;
+
             MWWorld::Scene *mWorldScene;
             MWWorld::Player *mPlayer;
             ESM::ESMReader mEsm;
@@ -95,17 +100,19 @@ namespace MWWorld
 
         public:
 
-           World (OEngine::Render::OgreRenderer& renderer, OEngine::Physic::PhysicEngine* physEng,
+           World (OEngine::Render::OgreRenderer& renderer,
                 const Files::Collections& fileCollections,
                 const std::string& master, const boost::filesystem::path& resDir, bool newGame,
                 Environment& environment, const std::string& encoding);
 
             ~World();
+            
+            OEngine::Render::Fader* getFader();
 
             Ptr::CellStore *getExterior (int x, int y);
 
             Ptr::CellStore *getInterior (const std::string& name);
-
+            
             void adjustSky();
 
             MWWorld::Player& getPlayer();
@@ -118,6 +125,9 @@ namespace MWWorld
 
             bool hasCellChanged() const;
             ///< Has the player moved to a different cell, since the last frame?
+            
+            bool isCellExterior() const;
+            bool isCellQuasiExterior() const;
 
             Globals::Data& getGlobalVariable (const std::string& name);
 
@@ -132,23 +142,31 @@ namespace MWWorld
 
             Ptr getPtrViaHandle (const std::string& handle);
             ///< Return a pointer to a liveCellRef with the given Ogre handle.
-            
+
             /// \todo enable reference in the OGRE scene
             void enable (Ptr reference);
-            
+
             /// \todo 5disable reference in the OGRE scene
             void disable (Ptr reference);
 
             void advanceTime (double hours);
+            ///< Advance in-game time.
 
             void setHour (double hour);
+            ///< Set in-game time hour.
 
             void setMonth (int month);
+            ///< Set in-game time month.
 
             void setDay (int day);
+            ///< Set in-game time day.
 
             bool toggleSky();
             ///< \return Resulting mode
+            
+            void changeWeather(const std::string& region, const unsigned int id);
+            
+            int getCurrentWeather() const;
 
             int getMasserPhase() const;
 
@@ -206,6 +224,21 @@ namespace MWWorld
             const ESM::Cell *createRecord (const ESM::Cell& record);
             ///< Create a new recrod (of type cell) in the ESM store.
             /// \return ID, pointer to created record
+
+            void playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode,
+                int number = 1);
+            ///< Run animation for a MW-reference. Calls to this function for references that are
+            /// currently not in the rendered scene should be ignored.
+            ///
+            /// \param mode: 0 normal, 1 immediate start, 2 immediate loop
+            /// \param number How offen the animation should be run
+
+            void skipAnimation (const MWWorld::Ptr& ptr);
+            ///< Skip the animation for the given MW-reference for one frame. Calls to this function for
+            /// references that are currently not in the rendered scene should be ignored.
+
+            void update (float duration);
+
     };
 }
 
diff --git a/cmake/FindOGRE.cmake b/cmake/FindOGRE.cmake
index c3b471bb21..dd20dc667a 100644
--- a/cmake/FindOGRE.cmake
+++ b/cmake/FindOGRE.cmake
@@ -1,125 +1,541 @@
-# Find OGRE includes and library
+#-------------------------------------------------------------------
+# This file is part of the CMake build system for OGRE
+#     (Object-oriented Graphics Rendering Engine)
+# For the latest info, see http://www.ogre3d.org/
 #
-# This module defines
-#  OGRE_INCLUDE_DIR
-#  OGRE_LIBRARIES, the libraries to link against to use OGRE.
-#  OGRE_LIB_DIR, the location of the libraries
-#  OGRE_FOUND, If false, do not try to use OGRE
+# The contents of this file are placed in the public domain. Feel
+# free to make use of it in any way you like.
+#-------------------------------------------------------------------
+
+# - Try to find OGRE
+# If you have multiple versions of Ogre installed, use the CMake or
+# the environment variable OGRE_HOME to point to the path where the
+# desired Ogre version can be found.
+# By default this script will look for a dynamic Ogre build. If you
+# need to link against static Ogre libraries, set the CMake variable
+# OGRE_STATIC to TRUE.
 #
-# Copyright © 2007, Matt Williams
+# Once done, this will define
 #
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-CMAKE_POLICY(PUSH)
+#  OGRE_FOUND - system has OGRE
+#  OGRE_INCLUDE_DIRS - the OGRE include directories 
+#  OGRE_LIBRARIES - link these to use the OGRE core
+#  OGRE_BINARY_REL - location of the main Ogre binary (win32 non-static only, release)
+#  OGRE_BINARY_DBG - location of the main Ogre binaries (win32 non-static only, debug)
+#
+# Additionally this script searches for the following optional
+# parts of the Ogre package:
+#  Plugin_BSPSceneManager, Plugin_CgProgramManager,
+#  Plugin_OctreeSceneManager, Plugin_OctreeZone,
+#  Plugin_ParticleFX, Plugin_PCZSceneManager,
+#  RenderSystem_GL, RenderSystem_Direct3D9,
+#  Paging, Terrain
+#
+# For each of these components, the following variables are defined:
+#
+#  OGRE_${COMPONENT}_FOUND - ${COMPONENT} is available
+#  OGRE_${COMPONENT}_INCLUDE_DIRS - additional include directories for ${COMPONENT}
+#  OGRE_${COMPONENT}_LIBRARIES - link these to use ${COMPONENT} 
+#  OGRE_${COMPONENT}_BINARY_REL - location of the component binary (win32 non-static only, release)
+#  OGRE_${COMPONENT}_BINARY_DBG - location of the component binary (win32 non-static only, debug)
+#
+# Finally, the following variables are defined:
+#
+#  OGRE_PLUGIN_DIR_REL - The directory where the release versions of
+#       the OGRE plugins are located
+#  OGRE_PLUGIN_DIR_DBG - The directory where the debug versions of
+#       the OGRE plugins are located
+#  OGRE_MEDIA_DIR - The directory where the OGRE sample media is
+#       located, if available
 
-IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR AND OGRE_LIB_DIR AND OGRE_PLUGIN_DIR)
-    SET(OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent
-ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR AND OGRE_LIB_DIR AND OGRE_PLUGIN_DIR)
+include(FindPkgMacros)
+include(PreprocessorUtils)
+findpkg_begin(OGRE)
 
-IF (WIN32) #Windows
-    MESSAGE(STATUS "Looking for OGRE")
-    SET(OGRESDK $ENV{OGRE_HOME})
-    SET(OGRESOURCE $ENV{OGRE_SRC})
-    IF (OGRESDK)
-        MESSAGE(STATUS "Using OGRE SDK")
-        STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESDK}")
-        SET(OGRE_INCLUDE_DIR ${OGRESDK}/include)
-        SET(OGRE_LIB_DIR ${OGRESDK}/lib)
-        SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
-    ENDIF (OGRESDK)
-    IF (OGRESOURCE)
-        MESSAGE(STATUS "Using OGRE built from source")
-        SET(OGRE_INCLUDE_DIR $ENV{OGRE_SRC}/OgreMain/include)
-        SET(OGRE_LIB_DIR $ENV{OGRE_SRC}/lib)
-        SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
-    ENDIF (OGRESOURCE)
-ENDIF (WIN32)
 
-IF (UNIX AND NOT APPLE)
-    CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
-    FIND_PACKAGE(PkgConfig REQUIRED)
-    # Don't mark REQUIRED, but use PKG_CHECK_MODULES below (otherwise PkgConfig
-    # complains even if OGRE_* are set by hand).
-    PKG_SEARCH_MODULE(OGRE OGRE)
-    SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS})
-    SET(OGRE_LIB_DIR ${OGRE_LIBDIR})
-    SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
-    PKG_CHECK_MODULES(OGRE OGRE)
-ENDIF (UNIX AND NOT APPLE)
+# Get path, convert backslashes as ${ENV_${var}}
+getenv_path(OGRE_HOME)
+getenv_path(OGRE_SDK)
+getenv_path(OGRE_SOURCE)
+getenv_path(OGRE_BUILD)
+getenv_path(OGRE_DEPENDENCIES_DIR)
+getenv_path(PROGRAMFILES)
 
-# on OS X we need Ogre SDK because framework doesn't include all libs, just Ogre Main lib
-IF (APPLE)
-	IF (OGRESDK)
-		MESSAGE(STATUS "Using Ogre SDK")
-		SET(OGRE_LIB_DIR ${OGRESDK}/lib)
-	ELSE (OGRESDK)
-		MESSAGE(FATAL_ERROR "Path to Ogre SDK not specified. Specify OGRESDK.")
-	ENDIF (OGRESDK)
-		
+# Determine whether to search for a dynamic or static build
+if (OGRE_STATIC)
+  set(OGRE_LIB_SUFFIX "Static")
+else ()
+  set(OGRE_LIB_SUFFIX "")
+endif ()
 
-	FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
-		PATHS
-		/Library/Frameworks
-		/opt/local
-	)
-	FIND_LIBRARY(OGRE_LIBRARIES
-		NAMES Ogre
-		PATHS
-		/Library/Frameworks
-		/opt/local
-	)
-ENDIF (APPLE)
 
-#Do some preparation
-SEPARATE_ARGUMENTS(OGRE_INCLUDE_DIR)
-SEPARATE_ARGUMENTS(OGRE_LIBRARIES)
+set(OGRE_LIBRARY_NAMES "OgreMain${OGRE_LIB_SUFFIX}")
+get_debug_names(OGRE_LIBRARY_NAMES)
 
-SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "")
-SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
-SET(OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "")
+# construct search paths from environmental hints and
+# OS specific guesses
+if (WIN32)
+  set(OGRE_PREFIX_GUESSES
+    ${ENV_PROGRAMFILES}/OGRE
+    C:/OgreSDK
+  )
+elseif (UNIX)
+  set(OGRE_PREFIX_GUESSES
+    /opt/ogre
+    /opt/OGRE
+    /usr/lib${LIB_SUFFIX}/ogre
+    /usr/lib${LIB_SUFFIX}/OGRE
+    /usr/local/lib${LIB_SUFFIX}/ogre
+    /usr/local/lib${LIB_SUFFIX}/OGRE
+    $ENV{HOME}/ogre
+    $ENV{HOME}/OGRE
+  )
+endif ()
+set(OGRE_PREFIX_PATH
+  ${OGRE_HOME} ${OGRE_SDK} ${ENV_OGRE_HOME} ${ENV_OGRE_SDK}
+  ${OGRE_PREFIX_GUESSES}
+)
+create_search_paths(OGRE)
+# If both OGRE_BUILD and OGRE_SOURCE are set, prepare to find Ogre in a build dir
+set(OGRE_PREFIX_SOURCE ${OGRE_SOURCE} ${ENV_OGRE_SOURCE})
+set(OGRE_PREFIX_BUILD ${OGRE_BUILD} ${ENV_OGRE_BUILD})
+set(OGRE_PREFIX_DEPENDENCIES_DIR ${OGRE_DEPENDENCIES_DIR} ${ENV_OGRE_DEPENDENCIES_DIR})
+if (OGRE_PREFIX_SOURCE AND OGRE_PREFIX_BUILD)
+  foreach(dir ${OGRE_PREFIX_SOURCE})
+    set(OGRE_INC_SEARCH_PATH ${dir}/OgreMain/include ${dir}/Dependencies/include ${dir}/iPhoneDependencies/include ${OGRE_INC_SEARCH_PATH})
+    set(OGRE_LIB_SEARCH_PATH ${dir}/lib ${dir}/Dependencies/lib ${dir}/iPhoneDependencies/lib ${OGRE_LIB_SEARCH_PATH})
+    set(OGRE_BIN_SEARCH_PATH ${dir}/Samples/Common/bin ${OGRE_BIN_SEARCH_PATH})
+  endforeach(dir)
+  foreach(dir ${OGRE_PREFIX_BUILD})
+    set(OGRE_INC_SEARCH_PATH ${dir}/include ${OGRE_INC_SEARCH_PATH})
+    set(OGRE_LIB_SEARCH_PATH ${dir}/lib ${OGRE_LIB_SEARCH_PATH})
+    set(OGRE_BIN_SEARCH_PATH ${dir}/bin ${OGRE_BIN_SEARCH_PATH})
+	set(OGRE_BIN_SEARCH_PATH ${dir}/Samples/Common/bin ${OGRE_BIN_SEARCH_PATH})
+  endforeach(dir)
+  
+  if (OGRE_PREFIX_DEPENDENCIES_DIR)
+    set(OGRE_INC_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/include ${OGRE_INC_SEARCH_PATH})
+    set(OGRE_LIB_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/lib ${OGRE_LIB_SEARCH_PATH})
+    set(OGRE_BIN_SEARCH_PATH ${OGRE_PREFIX_DEPENDENCIES_DIR}/bin ${OGRE_BIN_SEARCH_PATH})
+  endif()
+else()
+  set(OGRE_PREFIX_SOURCE "NOTFOUND")
+  set(OGRE_PREFIX_BUILD "NOTFOUND")
+endif ()
 
-if(OGRE_LIB_DIR)
-    CMAKE_POLICY(SET CMP0009 NEW)
-    IF (NOT APPLE)
-	   	FILE(GLOB_RECURSE OGRE_PLUGINS "${OGRE_LIB_DIR}/Plugin_*.so")
-	ENDIF (NOT APPLE)
-	IF (APPLE)
-   		FILE(GLOB_RECURSE OGRE_PLUGINS "${OGRE_LIB_DIR}/Plugin_*.dylib")
-   	ENDIF (APPLE)
-    FOREACH (OGRE_PLUGINS_FILE ${OGRE_PLUGINS})
-        STRING(REGEX REPLACE "/[^/]*$" "" OGRE_PLUGIN_DIR ${OGRE_PLUGINS_FILE})
-    ENDFOREACH(OGRE_PLUGINS_FILE)
+# redo search if any of the environmental hints changed
+set(OGRE_COMPONENTS Paging Terrain 
+  Plugin_BSPSceneManager Plugin_CgProgramManager Plugin_OctreeSceneManager
+  Plugin_OctreeZone Plugin_PCZSceneManager Plugin_ParticleFX
+  RenderSystem_Direct3D11 RenderSystem_Direct3D9 RenderSystem_GL RenderSystem_GLES RenderSystem_GLES2)
+set(OGRE_RESET_VARS 
+  OGRE_CONFIG_INCLUDE_DIR OGRE_INCLUDE_DIR 
+  OGRE_LIBRARY_FWK OGRE_LIBRARY_REL OGRE_LIBRARY_DBG
+  OGRE_PLUGIN_DIR_DBG OGRE_PLUGIN_DIR_REL OGRE_MEDIA_DIR)
+foreach (comp ${OGRE_COMPONENTS})
+  set(OGRE_RESET_VARS ${OGRE_RESET_VARS}
+    OGRE_${comp}_INCLUDE_DIR OGRE_${comp}_LIBRARY_FWK
+    OGRE_${comp}_LIBRARY_DBG OGRE_${comp}_LIBRARY_REL
+  )
+endforeach (comp)
+set(OGRE_PREFIX_WATCH ${OGRE_PREFIX_PATH} ${OGRE_PREFIX_SOURCE} ${OGRE_PREFIX_BUILD})
+clear_if_changed(OGRE_PREFIX_WATCH ${OGRE_RESET_VARS})
+
+# try to locate Ogre via pkg-config
+use_pkgconfig(OGRE_PKGC "OGRE${OGRE_LIB_SUFFIX}")
+
+if(NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
+  # try to find framework on OSX
+  findpkg_framework(OGRE)
+else()
+	set(OGRE_LIBRARY_FWK "")
 endif()
 
-IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES)
-    SET(OGRE_FOUND TRUE)
-ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES)
+# locate Ogre include files
+find_path(OGRE_CONFIG_INCLUDE_DIR NAMES OgreBuildSettings.h HINTS ${OGRE_INC_SEARCH_PATH} ${OGRE_FRAMEWORK_INCLUDES} ${OGRE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES "OGRE")
+find_path(OGRE_INCLUDE_DIR NAMES OgreRoot.h HINTS ${OGRE_CONFIG_INCLUDE_DIR} ${OGRE_INC_SEARCH_PATH} ${OGRE_FRAMEWORK_INCLUDES} ${OGRE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES "OGRE")
+set(OGRE_INCOMPATIBLE FALSE)
 
-IF (OGRE_FOUND)
-    # find terrain component
-    find_path(OGRE_Terrain_INCLUDE_DIR NAMES OgreTerrain.h HINTS ${OGRE_INCLUDE_DIR} PATH_SUFFIXES Terrain Components/Terrain/include)
-    set(OGRE_Terrain_LIBRARY_NAMES "OgreTerrain")
-    find_library(OGRE_Terrain_LIBRARY NAMES ${OGRE_Terrain_LIBRARY_NAMES} HINTS ${OGRE_LIB_DIR} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
-    if(OGRE_Terrain_INCLUDE_DIR AND OGRE_Terrain_LIBRARY)
-        SET(OGRE_Terrain_FOUND TRUE)
-    endif(OGRE_Terrain_INCLUDE_DIR AND OGRE_Terrain_LIBRARY)
+if (OGRE_INCLUDE_DIR)
+  if (NOT OGRE_CONFIG_INCLUDE_DIR)
+    set(OGRE_CONFIG_INCLUDE_DIR ${OGRE_INCLUDE_DIR})
+  endif ()
+  # determine Ogre version
+  file(READ ${OGRE_INCLUDE_DIR}/OgrePrerequisites.h OGRE_TEMP_VERSION_CONTENT)
+  get_preprocessor_entry(OGRE_TEMP_VERSION_CONTENT OGRE_VERSION_MAJOR OGRE_VERSION_MAJOR)
+  get_preprocessor_entry(OGRE_TEMP_VERSION_CONTENT OGRE_VERSION_MINOR OGRE_VERSION_MINOR)
+  get_preprocessor_entry(OGRE_TEMP_VERSION_CONTENT OGRE_VERSION_PATCH OGRE_VERSION_PATCH)
+  get_preprocessor_entry(OGRE_TEMP_VERSION_CONTENT OGRE_VERSION_NAME OGRE_VERSION_NAME)
+  set(OGRE_VERSION "${OGRE_VERSION_MAJOR}.${OGRE_VERSION_MINOR}.${OGRE_VERSION_PATCH}")
+  pkg_message(OGRE "Found Ogre ${OGRE_VERSION_NAME} (${OGRE_VERSION})")
 
-    IF (NOT OGRE_FIND_QUIETLY)
-        MESSAGE(STATUS "  libraries : ${OGRE_LIBRARIES} from ${OGRE_LIB_DIR}")
-        MESSAGE(STATUS "  includes  : ${OGRE_INCLUDE_DIR}")
-        MESSAGE(STATUS "  plugins   : ${OGRE_PLUGIN_DIR}")
-        IF (OGRE_Terrain_FOUND)
-            MESSAGE(STATUS "Ogre Terrain component found:")
-            MESSAGE(STATUS "  include   : ${OGRE_Terrain_INCLUDE_DIR}")
-            MESSAGE(STATUS "  library   : ${OGRE_Terrain_LIBRARY}")
-        ELSE (OGRE_Terrain_FOUND)
-            MESSAGE(FATAL_ERROR "Required Ogre terrain component not found")
-        ENDIF (OGRE_Terrain_FOUND)
-    ENDIF (NOT OGRE_FIND_QUIETLY)
-ELSE (OGRE_FOUND)
-    IF (OGRE_FIND_REQUIRED)
-        MESSAGE(FATAL_ERROR "Could not find OGRE")
-    ENDIF (OGRE_FIND_REQUIRED)
-ENDIF (OGRE_FOUND)
+  # determine configuration settings
+  set(OGRE_CONFIG_HEADERS
+    ${OGRE_CONFIG_INCLUDE_DIR}/OgreBuildSettings.h
+    ${OGRE_CONFIG_INCLUDE_DIR}/OgreConfig.h
+  )
+  foreach(CFG_FILE ${OGRE_CONFIG_HEADERS})
+    if (EXISTS ${CFG_FILE})
+      set(OGRE_CONFIG_HEADER ${CFG_FILE})
+      break()
+    endif()
+  endforeach()
+  if (OGRE_CONFIG_HEADER)
+    file(READ ${OGRE_CONFIG_HEADER} OGRE_TEMP_CONFIG_CONTENT)
+    has_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_STATIC_LIB OGRE_CONFIG_STATIC)
+    get_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_THREAD_SUPPORT OGRE_CONFIG_THREADS)
+    get_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_THREAD_PROVIDER OGRE_CONFIG_THREAD_PROVIDER)
+    get_preprocessor_entry(OGRE_TEMP_CONFIG_CONTENT OGRE_NO_FREEIMAGE OGRE_CONFIG_FREEIMAGE)
+    if (OGRE_CONFIG_STATIC AND OGRE_STATIC)
+    elseif (OGRE_CONFIG_STATIC OR OGRE_STATIC)
+      pkg_message(OGRE "Build type (static, dynamic) does not match the requested one.")
+      set(OGRE_INCOMPATIBLE TRUE)
+    endif ()
+  else ()
+    pkg_message(OGRE "Could not determine Ogre build configuration.")
+    set(OGRE_INCOMPATIBLE TRUE)
+  endif ()
+else ()
+  set(OGRE_INCOMPATIBLE FALSE)
+endif ()
 
-CMAKE_POLICY(POP)
+find_library(OGRE_LIBRARY_REL NAMES ${OGRE_LIBRARY_NAMES} HINTS ${OGRE_LIB_SEARCH_PATH} ${OGRE_PKGC_LIBRARY_DIRS} ${OGRE_FRAMEWORK_SEARCH_PATH} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
+find_library(OGRE_LIBRARY_DBG NAMES ${OGRE_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIB_SEARCH_PATH} ${OGRE_PKGC_LIBRARY_DIRS} ${OGRE_FRAMEWORK_SEARCH_PATH} PATH_SUFFIXES "" "debug")
+make_library_set(OGRE_LIBRARY)
+
+if(APPLE)
+  set(OGRE_LIBRARY_DBG ${OGRE_LIB_SEARCH_PATH})
+endif()
+if (OGRE_INCOMPATIBLE)
+  set(OGRE_LIBRARY "NOTFOUND")
+endif ()
+
+set(OGRE_INCLUDE_DIR ${OGRE_CONFIG_INCLUDE_DIR} ${OGRE_INCLUDE_DIR})
+list(REMOVE_DUPLICATES OGRE_INCLUDE_DIR)
+findpkg_finish(OGRE)
+add_parent_dir(OGRE_INCLUDE_DIRS OGRE_INCLUDE_DIR)
+if (OGRE_SOURCE)
+	# If working from source rather than SDK, add samples include
+	set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} "${OGRE_SOURCE}/Samples/Common/include")
+endif()
+
+mark_as_advanced(OGRE_CONFIG_INCLUDE_DIR OGRE_MEDIA_DIR OGRE_PLUGIN_DIR_REL OGRE_PLUGIN_DIR_DBG)
+
+if (NOT OGRE_FOUND)
+  return()
+endif ()
+
+
+# look for required Ogre dependencies in case of static build and/or threading
+if (OGRE_STATIC)
+  set(OGRE_DEPS_FOUND TRUE)
+  find_package(Cg QUIET)
+  find_package(DirectX QUIET)
+  find_package(FreeImage QUIET)
+  find_package(Freetype QUIET)
+  find_package(OpenGL QUIET)
+  find_package(OpenGLES QUIET)
+  find_package(OpenGLES2 QUIET)
+  find_package(ZLIB QUIET)
+  find_package(ZZip QUIET)
+  if (UNIX AND NOT APPLE)
+    find_package(X11 QUIET)
+    find_library(XAW_LIBRARY NAMES Xaw Xaw7 PATHS ${DEP_LIB_SEARCH_DIR} ${X11_LIB_SEARCH_PATH})
+    if (NOT XAW_LIBRARY OR NOT X11_Xt_FOUND)
+      set(X11_FOUND FALSE)
+    endif ()
+  endif ()
+  if (APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
+    find_package(Cocoa QUIET)
+    find_package(Carbon QUIET)
+    find_package(CoreVideo QUIET)
+    if (NOT Cocoa_FOUND OR NOT Carbon_FOUND OR NOT CoreVideo_FOUND)
+      set(OGRE_DEPS_FOUND FALSE)
+    endif ()
+  endif ()
+  if (APPLE AND OGRE_BUILD_PLATFORM_APPLE_IOS)
+    find_package(iPhoneSDK QUIET)
+    if (NOT iPhoneSDK_FOUND)
+      set(OGRE_DEPS_FOUND FALSE)
+    endif ()
+  endif ()
+
+  set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${ZZip_LIBRARIES} ${ZLIB_LIBRARIES} ${FreeImage_LIBRARIES} ${FREETYPE_LIBRARIES} )
+
+  if (APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
+    set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${X11_LIBRARIES} ${X11_Xt_LIBRARIES} ${XAW_LIBRARY} ${X11_Xrandr_LIB} ${Carbon_LIBRARIES} ${Cocoa_LIBRARIES})
+  endif()
+  
+  if (NOT ZLIB_FOUND OR NOT ZZip_FOUND)
+    set(OGRE_DEPS_FOUND FALSE)
+  endif ()
+  if (NOT FreeImage_FOUND AND NOT OGRE_CONFIG_FREEIMAGE)
+    set(OGRE_DEPS_FOUND FALSE)
+  endif ()
+  if (NOT FREETYPE_FOUND)
+    set(OGRE_DEPS_FOUND FALSE)
+  endif ()
+  if (UNIX AND NOT APPLE)
+	if (NOT X11_FOUND)
+      set(OGRE_DEPS_FOUND FALSE)
+	endif ()
+  endif ()
+
+  if (OGRE_CONFIG_THREADS)
+    if (OGRE_CONFIG_THREAD_PROVIDER EQUAL 1)
+      find_package(Boost COMPONENTS thread QUIET)
+      if (NOT Boost_THREAD_FOUND)
+        set(OGRE_DEPS_FOUND FALSE)
+      else ()
+        set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${Boost_LIBRARIES})
+        set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
+      endif ()
+    elseif (OGRE_CONFIG_THREAD_PROVIDER EQUAL 2)
+      find_package(POCO QUIET)
+      if (NOT POCO_FOUND)
+        set(OGRE_DEPS_FOUND FALSE)
+      else ()
+        set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${POCO_LIBRARIES})
+        set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} ${POCO_INCLUDE_DIRS})
+      endif ()
+    elseif (OGRE_CONFIG_THREAD_PROVIDER EQUAL 3)
+      find_package(TBB QUIET)
+      if (NOT TBB_FOUND)
+        set(OGRE_DEPS_FOUND FALSE)
+      else ()
+        set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${TBB_LIBRARIES})
+        set(OGRE_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS})
+      endif ()
+    endif ()
+  endif ()
+  
+  if (NOT OGRE_DEPS_FOUND)
+    pkg_message(OGRE "Could not find all required dependencies for the Ogre package.")
+    set(OGRE_FOUND FALSE)
+  endif ()
+endif ()
+
+if (NOT OGRE_FOUND)
+  return()
+endif ()
+
+
+get_filename_component(OGRE_LIBRARY_DIR_REL "${OGRE_LIBRARY_REL}" PATH)
+get_filename_component(OGRE_LIBRARY_DIR_DBG "${OGRE_LIBRARY_DBG}" PATH)
+set(OGRE_LIBRARY_DIRS ${OGRE_LIBRARY_DIR_REL} ${OGRE_LIBRARY_DIR_DBG})
+
+# find binaries
+if (NOT OGRE_STATIC)
+	if (WIN32)
+		find_file(OGRE_BINARY_REL NAMES "OgreMain.dll" HINTS ${OGRE_BIN_SEARCH_PATH}
+          PATH_SUFFIXES "" release relwithdebinfo minsizerel)
+		find_file(OGRE_BINARY_DBG NAMES "OgreMain_d.dll" HINTS ${OGRE_BIN_SEARCH_PATH}
+          PATH_SUFFIXES "" debug )
+	endif()
+	mark_as_advanced(OGRE_BINARY_REL OGRE_BINARY_DBG)
+endif()
+
+
+#########################################################
+# Find Ogre components
+#########################################################
+
+set(OGRE_COMPONENT_SEARCH_PATH_REL 
+  ${OGRE_LIBRARY_DIR_REL}/..
+  ${OGRE_LIBRARY_DIR_REL}/../..
+  ${OGRE_BIN_SEARCH_PATH}
+)
+set(OGRE_COMPONENT_SEARCH_PATH_DBG
+  ${OGRE_LIBRARY_DIR_DBG}/..
+  ${OGRE_LIBRARY_DIR_DBG}/../..
+  ${OGRE_BIN_SEARCH_PATH}
+)
+
+macro(ogre_find_component COMPONENT HEADER)
+  findpkg_begin(OGRE_${COMPONENT})
+  find_path(OGRE_${COMPONENT}_INCLUDE_DIR NAMES ${HEADER} HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES ${COMPONENT} OGRE/${COMPONENT} Components/${COMPONENT}/include)
+  set(OGRE_${COMPONENT}_LIBRARY_NAMES "Ogre${COMPONENT}${OGRE_LIB_SUFFIX}")
+  get_debug_names(OGRE_${COMPONENT}_LIBRARY_NAMES)
+  find_library(OGRE_${COMPONENT}_LIBRARY_REL NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
+  find_library(OGRE_${COMPONENT}_LIBRARY_DBG NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
+  make_library_set(OGRE_${COMPONENT}_LIBRARY)
+  findpkg_finish(OGRE_${COMPONENT})
+  if (OGRE_${COMPONENT}_FOUND)
+    # find binaries
+    if (NOT OGRE_STATIC)
+	  if (WIN32)
+	    find_file(OGRE_${COMPONENT}_BINARY_REL NAMES "Ogre${COMPONENT}.dll" HINTS ${OGRE_COMPONENT_SEARCH_PATH_REL} PATH_SUFFIXES "" bin bin/release bin/relwithdebinfo bin/minsizerel release)
+	    find_file(OGRE_${COMPONENT}_BINARY_DBG NAMES "Ogre${COMPONENT}_d.dll" HINTS ${OGRE_COMPONENT_SEARCH_PATH_DBG} PATH_SUFFIXES "" bin bin/debug debug)
+	  endif()
+	  mark_as_advanced(OGRE_${COMPONENT}_BINARY_REL OGRE_${COMPONENT}_BINARY_DBG)
+    endif()
+  endif()
+endmacro()
+
+# look for Paging component
+ogre_find_component(Paging OgrePaging.h)
+# look for Terrain component
+ogre_find_component(Terrain OgreTerrain.h)
+# look for Property component
+ogre_find_component(Property OgreProperty.h)
+# look for RTShaderSystem component
+ogre_find_component(RTShaderSystem OgreRTShaderSystem.h)
+
+
+#########################################################
+# Find Ogre plugins
+#########################################################
+
+macro(ogre_find_plugin PLUGIN HEADER)
+  # On Unix, the plugins might have no prefix
+  if (CMAKE_FIND_LIBRARY_PREFIXES)
+    set(TMP_CMAKE_LIB_PREFIX ${CMAKE_FIND_LIBRARY_PREFIXES})
+    set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "")
+  endif()
+  
+  # strip RenderSystem_ or Plugin_ prefix from plugin name
+  string(REPLACE "RenderSystem_" "" PLUGIN_TEMP ${PLUGIN})
+  string(REPLACE "Plugin_" "" PLUGIN_NAME ${PLUGIN_TEMP})
+  
+  # header files for plugins are not usually needed, but find them anyway if they are present
+  set(OGRE_PLUGIN_PATH_SUFFIXES
+    PlugIns PlugIns/${PLUGIN_NAME} Plugins Plugins/${PLUGIN_NAME} ${PLUGIN} 
+    RenderSystems RenderSystems/${PLUGIN_NAME} ${ARGN})
+  find_path(OGRE_${PLUGIN}_INCLUDE_DIR NAMES ${HEADER} 
+    HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE}  
+    PATH_SUFFIXES ${OGRE_PLUGIN_PATH_SUFFIXES})
+  # find link libraries for plugins
+  set(OGRE_${PLUGIN}_LIBRARY_NAMES "${PLUGIN}${OGRE_LIB_SUFFIX}")
+  get_debug_names(OGRE_${PLUGIN}_LIBRARY_NAMES)
+  set(OGRE_${PLUGIN}_LIBRARY_FWK ${OGRE_LIBRARY_FWK})
+  find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES}
+    HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt release release/opt relwithdebinfo relwithdebinfo/opt minsizerel minsizerel/opt)
+  find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG}
+    HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt debug debug/opt)
+  make_library_set(OGRE_${PLUGIN}_LIBRARY)
+
+  if (OGRE_${PLUGIN}_LIBRARY OR OGRE_${PLUGIN}_INCLUDE_DIR)
+    set(OGRE_${PLUGIN}_FOUND TRUE)
+    if (OGRE_${PLUGIN}_INCLUDE_DIR)
+      set(OGRE_${PLUGIN}_INCLUDE_DIRS ${OGRE_${PLUGIN}_INCLUDE_DIR})
+    endif()
+    set(OGRE_${PLUGIN}_LIBRARIES ${OGRE_${PLUGIN}_LIBRARY})
+  endif ()
+
+  mark_as_advanced(OGRE_${PLUGIN}_INCLUDE_DIR OGRE_${PLUGIN}_LIBRARY_REL OGRE_${PLUGIN}_LIBRARY_DBG OGRE_${PLUGIN}_LIBRARY_FWK)
+
+  # look for plugin dirs
+  if (OGRE_${PLUGIN}_FOUND)
+    if (NOT OGRE_PLUGIN_DIR_REL OR NOT OGRE_PLUGIN_DIR_DBG)
+      if (WIN32)
+        set(OGRE_PLUGIN_SEARCH_PATH_REL 
+          ${OGRE_LIBRARY_DIR_REL}/..
+          ${OGRE_LIBRARY_DIR_REL}/../..
+		  ${OGRE_BIN_SEARCH_PATH}
+        )
+        set(OGRE_PLUGIN_SEARCH_PATH_DBG
+          ${OGRE_LIBRARY_DIR_DBG}/..
+          ${OGRE_LIBRARY_DIR_DBG}/../..
+		  ${OGRE_BIN_SEARCH_PATH}
+        )
+        find_path(OGRE_PLUGIN_DIR_REL NAMES "${PLUGIN}.dll" HINTS ${OGRE_PLUGIN_SEARCH_PATH_REL}
+          PATH_SUFFIXES "" bin bin/release bin/relwithdebinfo bin/minsizerel release)
+        find_path(OGRE_PLUGIN_DIR_DBG NAMES "${PLUGIN}_d.dll" HINTS ${OGRE_PLUGIN_SEARCH_PATH_DBG}
+          PATH_SUFFIXES "" bin bin/debug debug)
+      elseif (UNIX)
+        get_filename_component(OGRE_PLUGIN_DIR_TMP ${OGRE_${PLUGIN}_LIBRARY_REL} PATH)
+        set(OGRE_PLUGIN_DIR_REL ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (release)" FORCE)
+        get_filename_component(OGRE_PLUGIN_DIR_TMP ${OGRE_${PLUGIN}_LIBRARY_DBG} PATH)
+        set(OGRE_PLUGIN_DIR_DBG ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (debug)" FORCE)
+      endif ()
+    endif ()
+	
+	# find binaries
+	if (NOT OGRE_STATIC)
+		if (WIN32)
+			find_file(OGRE_${PLUGIN}_REL NAMES "${PLUGIN}.dll" HINTS ${OGRE_PLUGIN_DIR_REL})
+			find_file(OGRE_${PLUGIN}_DBG NAMES "${PLUGIN}_d.dll" HINTS ${OGRE_PLUGIN_DIR_DBG})
+		endif()
+		mark_as_advanced(OGRE_${PLUGIN}_REL OGRE_${PLUGIN}_DBG)
+	endif()
+	
+  endif ()
+
+  if (TMP_CMAKE_LIB_PREFIX)
+    set(CMAKE_FIND_LIBRARY_PREFIXES ${TMP_CMAKE_LIB_PREFIX})
+  endif ()
+endmacro(ogre_find_plugin)
+
+ogre_find_plugin(Plugin_PCZSceneManager OgrePCZSceneManager.h PCZ PlugIns/PCZSceneManager/include)
+ogre_find_plugin(Plugin_OctreeZone OgreOctreeZone.h PCZ PlugIns/OctreeZone/include)
+ogre_find_plugin(Plugin_BSPSceneManager OgreBspSceneManager.h PlugIns/BSPSceneManager/include)
+ogre_find_plugin(Plugin_CgProgramManager OgreCgProgram.h PlugIns/CgProgramManager/include)
+ogre_find_plugin(Plugin_OctreeSceneManager OgreOctreeSceneManager.h PlugIns/OctreeSceneManager/include)
+ogre_find_plugin(Plugin_ParticleFX OgreParticleFXPrerequisites.h PlugIns/ParticleFX/include)
+ogre_find_plugin(RenderSystem_GL OgreGLRenderSystem.h RenderSystems/GL/include)
+ogre_find_plugin(RenderSystem_GLES OgreGLESRenderSystem.h RenderSystems/GLES/include)
+ogre_find_plugin(RenderSystem_GLES2 OgreGLES2RenderSystem.h RenderSystems/GLES2/include)
+ogre_find_plugin(RenderSystem_Direct3D9 OgreD3D9RenderSystem.h RenderSystems/Direct3D9/include)
+ogre_find_plugin(RenderSystem_Direct3D11 OgreD3D11RenderSystem.h RenderSystems/Direct3D11/include)
+
+if (OGRE_STATIC)
+  # check if dependencies for plugins are met
+  if (NOT DirectX_FOUND)
+    set(OGRE_RenderSystem_Direct3D9_FOUND FALSE)
+  endif ()
+  if (NOT DirectX_D3D11_FOUND)
+    set(OGRE_RenderSystem_Direct3D11_FOUND FALSE)
+  endif ()
+  if (NOT OPENGL_FOUND)
+    set(OGRE_RenderSystem_GL_FOUND FALSE)
+  endif ()
+  if (NOT OPENGLES_FOUND)
+    set(OGRE_RenderSystem_GLES_FOUND FALSE)
+  endif ()
+  if (NOT OPENGLES2_FOUND)
+    set(OGRE_RenderSystem_GLES2_FOUND FALSE)
+  endif ()
+  if (NOT Cg_FOUND)
+    set(OGRE_Plugin_CgProgramManager_FOUND FALSE)
+  endif ()
+  
+  set(OGRE_RenderSystem_Direct3D9_LIBRARIES ${OGRE_RenderSystem_Direct3D9_LIBRARIES}
+    ${DirectX_LIBRARIES}
+  )
+
+  set(OGRE_RenderSystem_Direct3D11_LIBRARIES ${OGRE_RenderSystem_Direct3D11_LIBRARIES}
+    ${DirectX_D3D11_LIBRARIES}
+  )
+  set(OGRE_RenderSystem_GL_LIBRARIES ${OGRE_RenderSystem_GL_LIBRARIES}
+    ${OPENGL_LIBRARIES}
+  )
+  set(OGRE_RenderSystem_GLES_LIBRARIES ${OGRE_RenderSystem_GLES_LIBRARIES}
+    ${OPENGLES_LIBRARIES}
+  )
+  set(OGRE_RenderSystem_GLES2_LIBRARIES ${OGRE_RenderSystem_GLES2_LIBRARIES}
+    ${OPENGLES2_LIBRARIES}
+  )
+  set(OGRE_Plugin_CgProgramManager_LIBRARIES ${OGRE_Plugin_CgProgramManager_LIBRARIES}
+    ${Cg_LIBRARIES}
+  )
+endif ()
+
+# look for the media directory
+set(OGRE_MEDIA_SEARCH_PATH
+  ${OGRE_SOURCE}
+  ${OGRE_LIBRARY_DIR_REL}/..
+  ${OGRE_LIBRARY_DIR_DBG}/..
+  ${OGRE_LIBRARY_DIR_REL}/../..
+  ${OGRE_LIBRARY_DIR_DBG}/../..
+  ${OGRE_PREFIX_SOURCE}
+)
+set(OGRE_MEDIA_SEARCH_SUFFIX
+  Samples/Media
+  Media
+  media
+  share/OGRE/media
+)
+
+clear_if_changed(OGRE_PREFIX_WATCH OGRE_MEDIA_DIR)
+find_path(OGRE_MEDIA_DIR NAMES packs/cubemapsJS.zip HINTS ${OGRE_MEDIA_SEARCH_PATH}
+  PATHS ${OGRE_PREFIX_PATH} PATH_SUFFIXES ${OGRE_MEDIA_SEARCH_SUFFIX})
diff --git a/cmake/FindPkgMacros.cmake b/cmake/FindPkgMacros.cmake
index da3303ac5c..473b27b2a7 100644
--- a/cmake/FindPkgMacros.cmake
+++ b/cmake/FindPkgMacros.cmake
@@ -50,6 +50,11 @@ endmacro(create_search_paths)
 # clear cache variables if a certain variable changed
 macro(clear_if_changed TESTVAR)
   # test against internal check variable
+  # HACK: Apparently, adding a variable to the cache cleans up the list
+  # a bit. We need to also remove any empty strings from the list, but
+  # at the same time ensure that we are actually dealing with a list.
+  list(APPEND ${TESTVAR} "")
+  list(REMOVE_ITEM ${TESTVAR} "")
   if (NOT "${${TESTVAR}}" STREQUAL "${${TESTVAR}_INT_CHECK}")
     message(STATUS "${TESTVAR} changed.")
     foreach(var ${ARGN})
@@ -129,9 +134,18 @@ MACRO(findpkg_framework fwk)
       /System/Library/Frameworks
       /Network/Library/Frameworks
       /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/
-      ${CMAKE_CURRENT_SOURCE_DIR}/../lib/Release
-      ${CMAKE_CURRENT_SOURCE_DIR}/../lib/Debug
+      ${CMAKE_CURRENT_SOURCE_DIR}/lib/Release
+      ${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug
     )
+    # These could be arrays of paths, add each individually to the search paths
+    foreach(i ${OGRE_PREFIX_PATH})
+      set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/Release ${i}/lib/Debug)
+    endforeach(i)
+
+    foreach(i ${OGRE_PREFIX_BUILD})
+      set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/Release ${i}/lib/Debug)
+    endforeach(i)
+
     FOREACH(dir ${${fwk}_FRAMEWORK_PATH})
       SET(fwkpath ${dir}/${fwk}.framework)
       IF(EXISTS ${fwkpath})
diff --git a/cmake/OpenMWMacros.cmake b/cmake/OpenMWMacros.cmake
index c409366912..024338d3ad 100644
--- a/cmake/OpenMWMacros.cmake
+++ b/cmake/OpenMWMacros.cmake
@@ -2,7 +2,7 @@
 macro (add_openmw_dir dir)
 set (files)
 foreach (u ${ARGN})
-file (GLOB ALL RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.*")
+file (GLOB ALL ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.[ch]pp")
 foreach (f ${ALL})
 list (APPEND files "${f}")
 list (APPEND OPENMW_FILES "${f}")
@@ -14,7 +14,7 @@ endmacro (add_openmw_dir)
 macro (add_component_dir dir)
 set (files)
 foreach (u ${ARGN})
-file (GLOB ALL RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.*")
+file (GLOB ALL ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.[ch]pp")
 foreach (f ${ALL})
 list (APPEND files "${f}")
 list (APPEND COMPONENT_FILES "${f}")
diff --git a/cmake/PreprocessorUtils.cmake b/cmake/PreprocessorUtils.cmake
new file mode 100644
index 0000000000..38462a98d4
--- /dev/null
+++ b/cmake/PreprocessorUtils.cmake
@@ -0,0 +1,60 @@
+#-------------------------------------------------------------------
+# This file is part of the CMake build system for OGRE
+#     (Object-oriented Graphics Rendering Engine)
+# For the latest info, see http://www.ogre3d.org/
+#
+# The contents of this file are placed in the public domain. Feel
+# free to make use of it in any way you like.
+#-------------------------------------------------------------------
+
+macro(get_preprocessor_entry CONTENTS KEYWORD VARIABLE)
+  string(REGEX MATCH
+    "# *define +${KEYWORD} +((\"([^\n]*)\")|([^ \n]*))"
+    PREPROC_TEMP_VAR
+    ${${CONTENTS}}
+  )
+  if (CMAKE_MATCH_3)
+    set(${VARIABLE} ${CMAKE_MATCH_3})
+  else ()
+    set(${VARIABLE} ${CMAKE_MATCH_4})
+  endif ()
+endmacro()
+
+macro(has_preprocessor_entry CONTENTS KEYWORD VARIABLE)
+  string(REGEX MATCH
+    "\n *# *define +(${KEYWORD})"
+    PREPROC_TEMP_VAR
+    ${${CONTENTS}}
+  )
+  if (CMAKE_MATCH_1)
+    set(${VARIABLE} TRUE)
+  else ()
+    set(${VARIABLE} FALSE)
+  endif ()
+endmacro()
+
+macro(replace_preprocessor_entry VARIABLE KEYWORD NEW_VALUE)
+  string(REGEX REPLACE 
+    "(// *)?# *define +${KEYWORD} +[^ \n]*"
+	"#define ${KEYWORD} ${NEW_VALUE}"
+	${VARIABLE}_TEMP
+	${${VARIABLE}}
+  )
+  set(${VARIABLE} ${${VARIABLE}_TEMP})  
+endmacro()
+
+macro(set_preprocessor_entry VARIABLE KEYWORD ENABLE)
+  if (${ENABLE})
+    set(TMP_REPLACE_STR "#define ${KEYWORD}")
+  else ()
+    set(TMP_REPLACE_STR "// #define ${KEYWORD}")
+  endif ()
+  string(REGEX REPLACE 
+    "(// *)?# *define +${KEYWORD} *\n"
+	${TMP_REPLACE_STR}
+	${VARIABLE}_TEMP
+	${${VARIABLE}}
+  )
+  set(${VARIABLE} ${${VARIABLE}_TEMP})  
+endmacro()
+  
diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt
index 76e68dd89e..7fcac6eb8c 100644
--- a/components/CMakeLists.txt
+++ b/components/CMakeLists.txt
@@ -63,4 +63,10 @@ add_component_dir (interpreter
 
 include_directories(${BULLET_INCLUDE_DIRS})
 
-add_library (components STATIC ${COMPONENT_FILES})
+add_library(components STATIC ${COMPONENT_FILES})
+
+target_link_libraries(components ${Boost_LIBRARIES} ${OGRE_LIBRARIES})
+
+# Make the variable accessible for other subdirectories
+set(COMPONENT_FILES ${COMPONENT_FILES} PARENT_SCOPE)
+
diff --git a/components/bsa/bsa_archive.cpp b/components/bsa/bsa_archive.cpp
index 2178be318e..72d15944d5 100644
--- a/components/bsa/bsa_archive.cpp
+++ b/components/bsa/bsa_archive.cpp
@@ -240,15 +240,36 @@ public:
     // should not have been declared const in the first place.
     BSAFile *narc = (BSAFile*)&arc;
 
+    String passed = filename;
+	if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' ||  filename.at(filename.length() - 1) == '<'
+		|| filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' ||  filename.at(filename.length() - 1) == ':'
+		|| filename.at(filename.length() - 1) == '|')
+	{
+	   passed = filename.substr(0, filename.length() - 2);
+	}
+	if(filename.at(filename.length() - 2) == '>')
+		passed = filename.substr(0, filename.length() - 6);
     // Open the file
-    StreamPtr strm = narc->getFile(filename.c_str());
+    StreamPtr strm = narc->getFile(passed.c_str());
 
     // Wrap it into an Ogre::DataStream.
     return DataStreamPtr(new Mangle2OgreStream(strm));
   }
 
   // Check if the file exists.
-  bool exists(const String& filename) { return arc.exists(filename.c_str()); }
+  bool exists(const String& filename) { 
+    String passed = filename;
+	if(filename.at(filename.length() - 1) == '*' || filename.at(filename.length() - 1) == '?' ||  filename.at(filename.length() - 1) == '<'
+		|| filename.at(filename.length() - 1) == '"' || filename.at(filename.length() - 1) == '>' ||  filename.at(filename.length() - 1) == ':'
+		|| filename.at(filename.length() - 1) == '|')
+	{
+	   passed = filename.substr(0, filename.length() - 2);
+	}
+	if(filename.at(filename.length() - 2) == '>')
+		passed = filename.substr(0, filename.length() - 6);
+
+return arc.exists(passed.c_str()); 
+}
   time_t getModifiedTime(const String&) { return 0; }
 
   // This is never called as far as I can see.
diff --git a/components/esm_store/cell_store.hpp b/components/esm_store/cell_store.hpp
index 951b0736a9..b733a7ee86 100644
--- a/components/esm_store/cell_store.hpp
+++ b/components/esm_store/cell_store.hpp
@@ -12,7 +12,6 @@
 
 #include "store.hpp"
 #include "components/esm/records.hpp"
-#include "components/esm/loadcell.hpp"
 
 #include <list>
 #include <string>
@@ -36,7 +35,7 @@ namespace ESMS
   {
     LiveCellRef(const CellRef& cref, const X* b = NULL) : base(b), ref(cref),
                                                           mData(ref) {}
-                                                          
+
 
     LiveCellRef(const X* b = NULL) : base(b), mData(ref) {}
 
@@ -224,7 +223,7 @@ namespace ESMS
             ++iter)
             if (!functor (iter->ref, iter->mData))
                 return false;
-        
+
         return true;
     }
 
diff --git a/components/nif/data.hpp b/components/nif/data.hpp
index c483b48735..df90797586 100644
--- a/components/nif/data.hpp
+++ b/components/nif/data.hpp
@@ -26,6 +26,7 @@
 
 #include "controlled.hpp"
 #include <iostream>
+#include <Ogre.h>
 
 namespace Nif
 {
@@ -366,6 +367,12 @@ public:
     Vector trans;    // Translation
     float scale;     // Probably scale (always 1)
   };
+  struct BoneTrafoCopy
+  {
+	  Ogre::Quaternion rotation;
+	  Ogre::Vector3 trans;
+	  float scale;
+  };
 
   struct VertWeight
   {
@@ -380,6 +387,19 @@ public:
     const Vector4 *unknown;
     Misc::SliceArray<VertWeight> weights;
   };
+  struct BoneInfoCopy
+  {
+	   std::string bonename;
+       unsigned short bonehandle;
+	   BoneTrafoCopy trafo;
+	   Vector4 unknown;
+       //std::vector<VertWeight> weights;
+  };
+  struct IndividualWeight
+  {
+      float weight;
+        unsigned int boneinfocopyindex;
+  };
 
   const BoneTrafo *trafo;
   std::vector<BoneInfo> bones;
@@ -412,92 +432,396 @@ public:
 
 class NiMorphData : public Record
 {
+	float startTime;
+	float stopTime;
+	std::vector<Ogre::Vector3> initialVertices;
+	std::vector<std::vector<float> > relevantTimes;
+	std::vector<std::vector<Ogre::Vector3> > relevantData;
+	std::vector<std::vector<Ogre::Vector3> > additionalVertices;
+
+
 public:
-  void read(NIFFile *nif)
+	  float getStartTime(){
+	     return startTime;
+	  }
+	  float getStopTime(){
+	      return stopTime;
+	  }
+	  void setStartTime(float time){
+			startTime = time;
+	  }
+
+	  void setStopTime(float time){
+			stopTime = time;
+	  }
+	  std::vector<Ogre::Vector3> getInitialVertices(){
+			return initialVertices;
+	  }
+	  std::vector<std::vector<Ogre::Vector3> > getRelevantData(){
+			return relevantData;
+	  }
+	  std::vector<std::vector<float> > getRelevantTimes(){
+			return relevantTimes;
+	  }
+	   std::vector<std::vector<Ogre::Vector3> > getAdditionalVertices(){
+			return additionalVertices;
+	  }
+	  
+void read(NIFFile *nif)
   {
     int morphCount = nif->getInt();
     int vertCount  = nif->getInt();
     nif->getByte();
+	int magic = nif->getInt();
+	/*int type =*/ nif->getInt();
+	for(int i = 0; i < vertCount; i++){
 
-    for(int i=0; i<morphCount; i++)
-      {
-        int magic = nif->getInt();
-        nif->getInt();
-        if(magic)
-          // Time, data, forward, backward tangents
-          nif->getFloatLen(4*magic);
-
-        nif->getFloatLen(vertCount*3);
+		float x = nif->getFloat();
+		float y = nif->getFloat();
+		float z = nif->getFloat();
+		initialVertices.push_back(Ogre::Vector3(x, y, z));
+	}
+	
+    for(int i=1; i<morphCount; i++)
+    {
+        magic = nif->getInt();
+        /*type =*/ nif->getInt();
+		std::vector<Ogre::Vector3> current;
+		std::vector<float> currentTime;
+        for(int i = 0; i < magic; i++){
+        // Time, data, forward, backward tangents
+	        float time = nif->getFloat();
+		    float x = nif->getFloat();
+		    float y = nif->getFloat();
+		    float z = nif->getFloat();
+		    current.push_back(Ogre::Vector3(x,y,z));
+		    currentTime.push_back(time);
+          //nif->getFloatLen(4*magic);
+		}
+		if(magic){
+			relevantData.push_back(current);
+			relevantTimes.push_back(currentTime);
+		}
+		std::vector<Ogre::Vector3> verts;
+        for(int i = 0; i < vertCount; i++){
+		    float x = nif->getFloat();
+		    float y = nif->getFloat();
+		    float z = nif->getFloat();
+		    verts.push_back(Ogre::Vector3(x, y, z));
+		}
+		additionalVertices.push_back(verts);
       }
   }
 };
 
+
 class NiKeyframeData : public Record
 {
-    public:
+	std::string bonename;
+	//Rotations
+	std::vector<Ogre::Quaternion> quats;
+	std::vector<Ogre::Vector3> tbc;
+	std::vector<float> rottime;
+	float startTime;
+	float stopTime;
+	int rtype;
 
-        void read(NIFFile *nif)
-        {
-            // Rotations first
-            int count = nif->getInt();
-            if(count)
-            {
-                int type = nif->getInt();
+	//Translations
+	std::vector<Ogre::Vector3> translist1;
+	std::vector<Ogre::Vector3> translist2;
+	std::vector<Ogre::Vector3> translist3;
+	std::vector<Ogre::Vector3> transtbc;
+	std::vector<float> transtime;
+	int ttype;
 
-                if(type == 1)
-                    nif->skip(count*4*5); // time + quaternion
-                else if(type == 3)
-                    nif->skip(count*4*8); // rot1 + tension+bias+continuity
-                else if(type == 4)
-                {
-                    for(int j=0;j<count;j++)
-                    {
-                        nif->getFloat(); // time
-                        for(int i=0; i<3; i++)
-                        {
-                            int cnt = nif->getInt();
-                            int type = nif->getInt();
-                            if(type == 1)
-                                nif->skip(cnt*4*2); // time + unknown
-                            else if(type == 2)
-                                nif->skip(cnt*4*4); // time + unknown vector
-                            else nif->fail("Unknown sub-rotation type");
-                        }
-                    }
-                }
-                else nif->fail("Unknown rotation type in NiKeyframeData");
-            }
+	//Scalings
 
-            // Then translation
-            count = nif->getInt();
+	std::vector<float> scalefactor;
+	std::vector<float> scaletime;
+	std::vector<float> forwards;
+	std::vector<float> backwards;
+	std::vector<Ogre::Vector3> tbcscale;
+	int stype;
 
-            if(count)
-            {
-                int type = nif->getInt();
+	
+	
+public:
+	void clone(NiKeyframeData c)
+	{
+		quats = c.getQuat();
+		tbc = c.getrTbc();
+		rottime = c.getrTime();
 
-                if(type == 1)
-                    nif->getFloatLen(count*4); // time + translation
-                else if(type == 2)
-                    nif->getFloatLen(count*10); // trans1 + forward + backward
-                else if(type == 3)
-                    nif->getFloatLen(count*7); // trans1 + tension,bias,continuity
-                else nif->fail("Unknown translation type");
-            }
+		//types
+		ttype = c.getTtype();
+		rtype = c.getRtype();
+		stype = c.getStype();
+
+
+		translist1 = c.getTranslist1();
+		translist2 =	c.getTranslist2();	
+        translist3 = c.getTranslist3();
+
+	    transtime = c.gettTime();
+	   
+	    bonename = c.getBonename();
+
+
+	}
+
+	void setBonename(std::string bone)
+	{
+		bonename = bone;
+	}
+	void setStartTime(float start)
+	{
+		startTime = start;
+	}
+  	void setStopTime(float end)
+	{
+		stopTime = end;
+	}
+  void read(NIFFile *nif)
+  {
+    // Rotations first
+    int count = nif->getInt();
+	//std::vector<Ogre::Quaternion> quat(count);
+	//std::vector<float> rottime(count);
+    if(count)
+      {
+
+		//TYPE1  LINEAR_KEY
+		//TYPE2  QUADRATIC_KEY
+		//TYPE3  TBC_KEY
+		//TYPE4  XYZ_ROTATION_KEY
+		//TYPE5  UNKNOWN_KEY
+        rtype = nif->getInt();
+		    //std::cout << "Count: " << count << "Type: " << type << "\n";
+
+        if(rtype == 1)
+		{
+			//We need to actually read in these values instead of skipping them
+			//nif->skip(count*4*5); // time + quaternion
+			for (int i = 0; i < count; i++) {
+			    float time = nif->getFloat();
+			    float w = nif->getFloat();
+			    float x = nif->getFloat();
+			    float y = nif->getFloat();
+			    float z = nif->getFloat();
+				Ogre::Quaternion quat = Ogre::Quaternion(Ogre::Real(w), Ogre::Real(x), Ogre::Real(y), Ogre::Real(z));
+				quats.push_back(quat);
+				rottime.push_back(time);
+				//if(time == 0.0 || time > 355.5) 
+					// std::cout <<"Time:" << time << "W:" << w <<"X:" << x << "Y:" << y << "Z:" << z << "\n";
+			}
+		}
+        else if(rtype == 3)
+		{                  //Example - node 116 in base_anim.nif
+			for (int i = 0; i < count; i++) {
+			    float time = nif->getFloat();
+			    float w = nif->getFloat();
+			    float x = nif->getFloat();
+			    float y = nif->getFloat();
+			    float z = nif->getFloat();
+
+				float tbcx = nif->getFloat();
+				float tbcy = nif->getFloat();
+				float tbcz = nif->getFloat();
+				Ogre::Quaternion quat = Ogre::Quaternion(Ogre::Real(w), Ogre::Real(x), Ogre::Real(y), Ogre::Real(z));
+				Ogre::Vector3 vec = Ogre::Vector3(tbcx, tbcy, tbcz);
+				quats.push_back(quat);
+				rottime.push_back(time);
+				tbc.push_back(vec);
+				//if(time == 0.0 || time > 355.5) 
+					// std::cout <<"Time:" << time << "W:" << w <<"X:" << x << "Y:" << y << "Z:" << z << "\n";
+			}
+
+          //nif->skip(count*4*8); // rot1 + tension+bias+continuity
+		}
+        else if(rtype == 4)
+          {
+            for(int j=0;j<count;j++)
+              {
+                nif->getFloat(); // time
+                for(int i=0; i<3; i++)
+                  {
+                    int cnt = nif->getInt();
+                    int type = nif->getInt();
+                    if(type == 1)
+                      nif->skip(cnt*4*2); // time + unknown
+                    else if(type == 2)
+                      nif->skip(cnt*4*4); // time + unknown vector
+                    else nif->fail("Unknown sub-rotation type");
+                  }
+              }
+          }
+        else nif->fail("Unknown rotation type in NiKeyframeData");
+      }
+	//first = false;
+
+    // Then translation
+    count = nif->getInt();
+	
+    if(count)
+      {
+       ttype = nif->getInt();
+
+		//std::cout << "TransCount:" << count << " Type: " << type << "\n";
+        if(ttype == 1) {
+			for (int i = 0; i < count; i++) {
+				float time = nif->getFloat();
+				float x = nif->getFloat();
+				float y = nif->getFloat();
+				float z = nif->getFloat();
+				Ogre::Vector3 trans = Ogre::Vector3(x, y, z);
+				translist1.push_back(trans);
+				transtime.push_back(time);
+			}
+			//nif->getFloatLen(count*4); // time + translation
+		}
+        else if(ttype == 2)
+		{                                        //Example - node 116 in base_anim.nif
+			for (int i = 0; i < count; i++) {
+				float time = nif->getFloat();
+				float x = nif->getFloat();
+				float y = nif->getFloat();
+				float z = nif->getFloat();
+				float x2 = nif->getFloat();
+				float y2 = nif->getFloat();
+				float z2 = nif->getFloat();
+				float x3 = nif->getFloat();
+				float y3 = nif->getFloat();
+				float z3 = nif->getFloat();
+				Ogre::Vector3 trans = Ogre::Vector3(x, y, z);
+				Ogre::Vector3 trans2 = Ogre::Vector3(x2, y2, z2);
+				Ogre::Vector3 trans3 = Ogre::Vector3(x3, y3, z3);
+				transtime.push_back(time);
+				translist1.push_back(trans);
+				translist2.push_back(trans2);
+				translist3.push_back(trans3);
+			}
+			
+			//nif->getFloatLen(count*10); // trans1 + forward + backward
+		}
+        else if(ttype == 3){
+			for (int i = 0; i < count; i++) {
+				float time = nif->getFloat();
+				float x = nif->getFloat();
+				float y = nif->getFloat();
+				float z = nif->getFloat();
+				float t = nif->getFloat();
+				float b = nif->getFloat();
+				float c = nif->getFloat();
+				Ogre::Vector3 trans = Ogre::Vector3(x, y, z);
+				Ogre::Vector3 tbc = Ogre::Vector3(t, b, c);
+				translist1.push_back(trans);
+				transtbc.push_back(tbc);
+				transtime.push_back(time);
+			}
+          //nif->getFloatLen(count*7); // trans1 + tension,bias,continuity
+		}
+        else nif->fail("Unknown translation type");
+      }
+
+    // Finally, scalings
+    count = nif->getInt();
+    if(count)
+      {
+        stype = nif->getInt();
+
+		
+		for(int i = 0; i < count; i++){
+					
+				
+        //int size = 0;
+        if(stype >= 1 && stype < 4) 
+			{
+				float time = nif->getFloat();
+				float scale = nif->getFloat();
+				scaletime.push_back(time);
+				scalefactor.push_back(scale);
+				//size = 2; // time+scale
+			}
+		else nif->fail("Unknown scaling type");
+         if(stype == 2){
+			//size = 4; // 1 + forward + backward (floats)
+			float forward = nif->getFloat();
+			float backward = nif->getFloat();
+			forwards.push_back(forward);
+			backwards.push_back(backward);
+		}
+		else if(stype == 3){
+			float tbcx = nif->getFloat();
+			float tbcy = nif->getFloat();
+			float tbcz = nif->getFloat();
+			Ogre::Vector3 vec = Ogre::Vector3(tbcx, tbcy, tbcz);
+			tbcscale.push_back(vec);
+
+			//size = 5; // 1 + tbc
+		}
+        
+		}
+      }
+	  else 
+		  stype = 0;
+  }
+  	int getRtype(){
+		return rtype;
+	}
+	int getStype(){
+		return stype;
+	}
+	int getTtype(){
+		return ttype;
+	}
+	float getStartTime(){
+		return startTime;
+	}
+	float getStopTime(){
+		return stopTime;
+	}
+	std::vector<Ogre::Quaternion> getQuat(){
+		return quats;
+	}
+	std::vector<Ogre::Vector3> getrTbc(){
+		return tbc;
+	}
+	std::vector<float> getrTime(){
+		return rottime;
+	}
+
+	std::vector<Ogre::Vector3> getTranslist1(){
+		return translist1;
+	}
+	std::vector<Ogre::Vector3> getTranslist2(){
+		return translist2;
+	}
+	std::vector<Ogre::Vector3> getTranslist3(){
+		return translist3;
+	}
+	std::vector<float> gettTime(){
+		return transtime;
+	}
+	std::vector<float> getScalefactor(){
+		return scalefactor;
+	}
+	std::vector<float> getForwards(){
+		return forwards;
+	}
+	std::vector<float> getBackwards(){
+		return backwards;
+	}
+	std::vector<Ogre::Vector3> getScaleTbc(){
+		return tbcscale;
+	}
+
+	std::vector<float> getsTime(){
+		return scaletime;
+	}
+	std::string getBonename(){ return bonename;
+	}
 
-            // Finally, scalings
-            count = nif->getInt();
-            if(count)
-            {
-                int type = nif->getInt();
 
-                int size = 0;
-                if(type == 1) size = 2; // time+scale
-                else if(type == 2) size = 4; // 1 + forward + backward (floats)
-                else if(type == 3) size = 5; // 1 + tbc
-                else nif->fail("Unknown scaling type");
-                nif->getFloatLen(count*size);
-            }
-        }
 };
 
 } // Namespace
diff --git a/components/nif/node.hpp b/components/nif/node.hpp
index f0ad546552..0800427466 100644
--- a/components/nif/node.hpp
+++ b/components/nif/node.hpp
@@ -93,6 +93,20 @@ public:
   }
 };
 
+struct NiTriShapeCopy
+{
+ std::string sname;
+ std::vector<std::string> boneSequence;
+ Nif::NiSkinData::BoneTrafoCopy trafo;
+ //Ogre::Quaternion initialBoneRotation;
+ //Ogre::Vector3 initialBoneTranslation;
+ std::vector<Ogre::Vector3> vertices;
+ std::vector<Ogre::Vector3> normals;
+ std::vector<Nif::NiSkinData::BoneInfoCopy> boneinfo;
+ std::map<int, std::vector<Nif::NiSkinData::IndividualWeight> > vertsToWeights;
+ Nif::NiMorphData morph;
+};
+
 struct NiNode : Node
 {
   NodeList children;
@@ -133,6 +147,27 @@ struct NiTriShape : Node
     data.read(nif);
     skin.read(nif);
   }
+
+  NiTriShapeCopy clone(){
+	  NiTriShapeCopy copy;
+      copy.sname = name.toString();
+	  float *ptr = (float*)data->vertices.ptr;
+	  float *ptrNormals = (float*)data->normals.ptr;
+	  int numVerts = data->vertices.length / 3;
+	  for(int i = 0; i < numVerts; i++)
+	  {
+		   float *current = (float*) (ptr + i * 3);
+		   copy.vertices.push_back(Ogre::Vector3(*current, *(current + 1), *(current + 2)));
+
+		   if(ptrNormals){
+			float *currentNormals = (float*) (ptrNormals + i * 3);
+		   copy.normals.push_back(Ogre::Vector3(*currentNormals, *(currentNormals + 1), *(currentNormals + 2)));
+	 		  }
+      }
+
+
+  return copy;
+  }
 };
 
 struct NiCamera : Node
@@ -186,5 +221,7 @@ struct NiRotatingParticles : Node
   }
 };
 
+
+
 } // Namespace
 #endif
diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp
index 668fdcceb4..8b55400193 100644
--- a/components/nifogre/ogre_nif_loader.cpp
+++ b/components/nifogre/ogre_nif_loader.cpp
@@ -24,25 +24,7 @@
 //loadResource->handleNode->handleNiTriShape->createSubMesh
 
 #include "ogre_nif_loader.hpp"
-#include <Ogre.h>
-#include <stdio.h>
 
-#include <libs/mangle/vfs/servers/ogre_vfs.hpp>
-#include "../nif/nif_file.hpp"
-#include "../nif/node.hpp"
-#include "../nif/data.hpp"
-#include "../nif/property.hpp"
-#include "../nif/controller.hpp"
-#include "../nif/extra.hpp"
-#include <libs/platform/strings.h>
-
-#include <vector>
-#include <list>
-// For warning messages
-#include <iostream>
-
-// float infinity
-#include <limits>
 
 typedef unsigned char ubyte;
 
@@ -219,6 +201,12 @@ static CompareFunction getTestMode(int mode)
 }
 */
 
+void NIFLoader::setOutputAnimFiles(bool output){
+    mOutputAnimFiles = output;
+}
+void NIFLoader::setVerbosePath(std::string path){
+    verbosePath = path;
+}
 void NIFLoader::createMaterial(const String &name,
                            const Vector &ambient,
                            const Vector &diffuse,
@@ -230,11 +218,25 @@ void NIFLoader::createMaterial(const String &name,
 {
     MaterialPtr material = MaterialManager::getSingleton().create(name, resourceGroup);
 
+
+    //Hardware Skinning code, textures may be the wrong color if enabled
+
+    /* if(!mSkel.isNull()){
+    material->removeAllTechniques();
+
+        Ogre::Technique* tech = material->createTechnique();
+        //tech->setSchemeName("blahblah");
+        Pass* pass = tech->createPass();
+        pass->setVertexProgram("Ogre/BasicVertexPrograms/AmbientOneTexture");*/
+   
+
     // This assigns the texture to this material. If the texture name is
     // a file name, and this file exists (in a resource directory), it
     // will automatically be loaded when needed. If not (such as for
     // internal NIF textures that we might support later), we should
     // already have inserted a manual loader for the texture.
+
+
     if (!texName.empty())
     {
         Pass *pass = material->getTechnique(0)->getPass(0);
@@ -294,6 +296,8 @@ void NIFLoader::createMaterial(const String &name,
     material->setSpecular(specular.array[0], specular.array[1], specular.array[2], alpha);
     material->setSelfIllumination(emissive.array[0], emissive.array[1], emissive.array[2]);
     material->setShininess(glossiness);
+
+
 }
 
 // Takes a name and adds a unique part to it. This is just used to
@@ -355,23 +359,73 @@ void NIFLoader::createOgreSubMesh(NiTriShape *shape, const String &material, std
     HardwareVertexBufferSharedPtr vbuf =
         HardwareBufferManager::getSingleton().createVertexBuffer(
             VertexElement::getTypeSize(VET_FLOAT3),
-            numVerts, HardwareBuffer::HBU_STATIC_WRITE_ONLY);
-    vbuf->writeData(0, vbuf->getSizeInBytes(), data->vertices.ptr, true);
+            numVerts, HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, false);
+
+    if(flip)
+	{
+		float *datamod = new float[data->vertices.length];
+		//std::cout << "Shape" << shape->name.toString() << "\n";
+		for(int i = 0; i < numVerts; i++)
+		{
+			int index = i * 3;
+			const float *pos = data->vertices.ptr + index;
+		    Ogre::Vector3 original = Ogre::Vector3(*pos  ,*(pos+1), *(pos+2));
+			original = mTransform * original;
+			mBoundingBox.merge(original);
+			datamod[index] = original.x;
+			datamod[index+1] = original.y;
+			datamod[index+2] = original.z;
+		}
+		 vbuf->writeData(0, vbuf->getSizeInBytes(), datamod, false);
+	}
+	else
+	{
+		vbuf->writeData(0, vbuf->getSizeInBytes(), data->vertices.ptr, false);
+	}
+
 
     VertexBufferBinding* bind = sub->vertexData->vertexBufferBinding;
     bind->setBinding(nextBuf++, vbuf);
 
-    // Vertex normals
     if (data->normals.length)
     {
         decl->addElement(nextBuf, 0, VET_FLOAT3, VES_NORMAL);
         vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(
                    VertexElement::getTypeSize(VET_FLOAT3),
-                   numVerts, HardwareBuffer::HBU_STATIC_WRITE_ONLY);
-        vbuf->writeData(0, vbuf->getSizeInBytes(), data->normals.ptr, true);
+                   numVerts, HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
+
+		if(flip)
+		{
+			Quaternion rotation = mTransform.extractQuaternion();
+			rotation.normalise();
+
+			float *datamod = new float[data->normals.length];
+			for(int i = 0; i < numVerts; i++)
+		    {
+			    int index = i * 3;
+			    const float *pos = data->normals.ptr + index;
+		        Ogre::Vector3 original = Ogre::Vector3(*pos  ,*(pos+1), *(pos+2));
+				original = rotation * original;
+				if (mNormaliseNormals)
+			    {
+                    original.normalise();
+				}
+
+
+			    datamod[index] = original.x;
+			    datamod[index+1] = original.y;
+			    datamod[index+2] = original.z;
+		    }
+			vbuf->writeData(0, vbuf->getSizeInBytes(), datamod, false);
+		}
+		else
+		{
+            vbuf->writeData(0, vbuf->getSizeInBytes(), data->normals.ptr, false);
+		}
         bind->setBinding(nextBuf++, vbuf);
     }
 
+    
     // Vertex colors
     if (data->colors.length)
     {
@@ -393,30 +447,79 @@ void NIFLoader::createOgreSubMesh(NiTriShape *shape, const String &material, std
         bind->setBinding(nextBuf++, vbuf);
     }
 
-    // Texture UV coordinates
-    if (data->uvlist.length)
+     if (data->uvlist.length)
     {
+
         decl->addElement(nextBuf, 0, VET_FLOAT2, VES_TEXTURE_COORDINATES);
         vbuf = HardwareBufferManager::getSingleton().createVertexBuffer(
                    VertexElement::getTypeSize(VET_FLOAT2),
-                   numVerts, HardwareBuffer::HBU_STATIC_WRITE_ONLY);
+                   numVerts, HardwareBuffer::HBU_STATIC_WRITE_ONLY,false);
 
-        vbuf->writeData(0, vbuf->getSizeInBytes(), data->uvlist.ptr, true);
+		if(flip)
+		{
+		    float *datamod = new float[data->uvlist.length];
+
+		    for(unsigned int i = 0; i < data->uvlist.length; i+=2){
+			    float x = *(data->uvlist.ptr + i);
+
+			    float y = *(data->uvlist.ptr + i + 1);
+
+			    datamod[i] =x;
+				datamod[i + 1] =y;
+		    }
+			vbuf->writeData(0, vbuf->getSizeInBytes(), datamod, false);
+		}
+		else
+			vbuf->writeData(0, vbuf->getSizeInBytes(), data->uvlist.ptr, false);
         bind->setBinding(nextBuf++, vbuf);
     }
 
-    // Triangle faces
+   // Triangle faces - The total number of triangle points
     int numFaces = data->triangles.length;
+
     if (numFaces)
     {
+
+		sub->indexData->indexCount = numFaces;
+        sub->indexData->indexStart = 0;
         HardwareIndexBufferSharedPtr ibuf = HardwareBufferManager::getSingleton().
                                             createIndexBuffer(HardwareIndexBuffer::IT_16BIT,
                                                               numFaces,
-                                                              HardwareBuffer::HBU_STATIC_WRITE_ONLY);
-        ibuf->writeData(0, ibuf->getSizeInBytes(), data->triangles.ptr, true);
+                                                              HardwareBuffer::HBU_STATIC_WRITE_ONLY, true);
+
+		if(flip && mFlipVertexWinding && sub->indexData->indexCount % 3 == 0){
+
+			sub->indexData->indexBuffer = ibuf;
+
+			uint16 *datamod = new uint16[numFaces];
+			int index = 0;
+			for (size_t i = 0; i < sub->indexData->indexCount; i+=3)
+			{
+
+			     const short *pos = data->triangles.ptr + index;
+				uint16 i0 = (uint16) *(pos+0);
+				uint16 i1 = (uint16) *(pos+1);
+				uint16 i2 = (uint16) *(pos+2);
+
+				//std::cout << "i0: " << i0 << "i1: " << i1 << "i2: " << i2 << "\n";
+
+
+				datamod[index] = i2;
+				datamod[index+1] = i1;
+				datamod[index+2] = i0;
+
+				index += 3;
+			}
+
+			 ibuf->writeData(0, ibuf->getSizeInBytes(), datamod, false);
+
+		}
+		else
+		     ibuf->writeData(0, ibuf->getSizeInBytes(), data->triangles.ptr, false);
         sub->indexData->indexBuffer = ibuf;
-        sub->indexData->indexCount = numFaces;
-        sub->indexData->indexStart = 0;
+
+
+
     }
 
     // Set material if one was given
@@ -429,6 +532,8 @@ void NIFLoader::createOgreSubMesh(NiTriShape *shape, const String &material, std
     {
             sub->addBoneAssignment(*it);
     }
+    if(mSkel.isNull())
+       needBoneAssignments.push_back(sub);
 }
 
 // Helper math functions. Reinventing linear algebra for the win!
@@ -475,10 +580,11 @@ static void vectorMul(const Matrix &A, float *C)
 }
 
 
-void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bounds)
+void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bounds, Transformation original, std::vector<std::string> boneSequence)
 {
     assert(shape != NULL);
 
+    bool saveTheShape = inTheSkeletonTree;
     // Interpret flags
     bool hidden    = (flags & 0x01) != 0; // Not displayed
     bool collide   = (flags & 0x02) != 0; // Use mesh for collision
@@ -636,11 +742,31 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou
 
     std::list<VertexBoneAssignment> vertexBoneAssignments;
 
+    Nif::NiTriShapeCopy copy = shape->clone();
+   
+	if(!shape->controller.empty())
+	{
+		Nif::Controller* cont = shape->controller.getPtr();
+		if(cont->recType == RC_NiGeomMorpherController)
+		{
+			Nif::NiGeomMorpherController* morph = dynamic_cast<Nif::NiGeomMorpherController*> (cont);
+			copy.morph = morph->data.get();
+			copy.morph.setStartTime(morph->timeStart);
+			copy.morph.setStopTime(morph->timeStop);
+            saveTheShape = true;
+		}
+
+	}
     //use niskindata for the position of vertices.
     if (!shape->skin.empty())
     {
-        // vector that stores if the position if a vertex is absolute
+
+
+
+        // vector that stores if the position of a vertex is absolute
         std::vector<bool> vertexPosAbsolut(numVerts,false);
+		std::vector<Ogre::Vector3> vertexPosOriginal(numVerts, Ogre::Vector3::ZERO);
+		std::vector<Ogre::Vector3> vertexNormalOriginal(numVerts, Ogre::Vector3::ZERO);
 
         float *ptrNormals = (float*)data->normals.ptr;
         //the bone from skin->bones[boneIndex] is linked to skin->data->bones[boneIndex]
@@ -667,24 +793,50 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou
                 break;
             }
             //get the bone from bones array of skindata
+			if(!mSkel->hasBone(shape->skin->bones[boneIndex].name.toString()))
+				std::cout << "We don't have this bone";
             bonePtr = mSkel->getBone(shape->skin->bones[boneIndex].name.toString());
 
             // final_vector = old_vector + old_rotation*new_vector*old_scale
-            vecPos = bonePtr->_getDerivedPosition() +
+
+
+			Nif::NiSkinData::BoneInfoCopy boneinfocopy;
+			boneinfocopy.trafo.rotation = convertRotation(it->trafo->rotation);
+			boneinfocopy.trafo.trans = convertVector3(it->trafo->trans);
+			boneinfocopy.bonename = shape->skin->bones[boneIndex].name.toString();
+            boneinfocopy.bonehandle = bonePtr->getHandle();
+            copy.boneinfo.push_back(boneinfocopy);
+            for (unsigned int i=0; i<it->weights.length; i++)
+            {
+				 vecPos = bonePtr->_getDerivedPosition() +
                 bonePtr->_getDerivedOrientation() * convertVector3(it->trafo->trans);
 
             vecRot = bonePtr->_getDerivedOrientation() * convertRotation(it->trafo->rotation);
-
-            for (unsigned int i=0; i<it->weights.length; i++)
-            {
                 unsigned int verIndex = (it->weights.ptr + i)->vertex;
+				//boneinfo.weights.push_back(*(it->weights.ptr + i));
+                Nif::NiSkinData::IndividualWeight ind;
+                ind.weight = (it->weights.ptr + i)->weight;
+                ind.boneinfocopyindex = copy.boneinfo.size() - 1;
+                if(copy.vertsToWeights.find(verIndex) == copy.vertsToWeights.end())
+                {
+                    std::vector<Nif::NiSkinData::IndividualWeight> blank;
+                    blank.push_back(ind);
+                    copy.vertsToWeights[verIndex] = blank;
+                }
+                else
+                {
+                    copy.vertsToWeights[verIndex].push_back(ind);
+                }
 
                 //Check if the vertex is relativ, FIXME: Is there a better solution?
                 if (vertexPosAbsolut[verIndex] == false)
                 {
                     //apply transformation to the vertices
                     Vector3 absVertPos = vecPos + vecRot * Vector3(ptr + verIndex *3);
+					absVertPos = absVertPos * (it->weights.ptr + i)->weight;
+					vertexPosOriginal[verIndex] = Vector3(ptr + verIndex *3);
 
+					mBoundingBox.merge(absVertPos);
                     //convert it back to float *
                     for (int j=0; j<3; j++)
                         (ptr + verIndex*3)[j] = absVertPos[j];
@@ -694,6 +846,8 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou
                     if (verIndex < data->normals.length)
                     {
                         Vector3 absNormalsPos = vecRot * Vector3(ptrNormals + verIndex *3);
+						absNormalsPos = absNormalsPos * (it->weights.ptr + i)->weight;
+						vertexNormalOriginal[verIndex] = Vector3(ptrNormals + verIndex *3);
 
                         for (int j=0; j<3; j++)
                             (ptrNormals + verIndex*3)[j] = absNormalsPos[j];
@@ -701,27 +855,68 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou
 
                     vertexPosAbsolut[verIndex] = true;
                 }
+				else
+				{
+					Vector3 absVertPos = vecPos + vecRot * vertexPosOriginal[verIndex];
+					absVertPos = absVertPos * (it->weights.ptr + i)->weight;
+					Vector3 old = Vector3(ptr + verIndex *3);
+					absVertPos = absVertPos + old;
+
+					mBoundingBox.merge(absVertPos);
+                    //convert it back to float *
+                    for (int j=0; j<3; j++)
+                        (ptr + verIndex*3)[j] = absVertPos[j];
+
+                    //apply rotation to the normals (not every vertex has a normal)
+                    //FIXME: I guessed that vertex[i] = normal[i], is that true?
+                    if (verIndex < data->normals.length)
+                    {
+                        Vector3 absNormalsPos = vecRot * vertexNormalOriginal[verIndex];
+						absNormalsPos = absNormalsPos * (it->weights.ptr + i)->weight;
+						Vector3 oldNormal = Vector3(ptrNormals + verIndex *3);
+						absNormalsPos = absNormalsPos + oldNormal;
+
+                        for (int j=0; j<3; j++)
+                            (ptrNormals + verIndex*3)[j] = absNormalsPos[j];
+                    }
+				}
+
 
                 VertexBoneAssignment vba;
                 vba.boneIndex = bonePtr->getHandle();
                 vba.vertexIndex = verIndex;
                 vba.weight = (it->weights.ptr + i)->weight;
 
+
                 vertexBoneAssignments.push_back(vba);
             }
 
+
             boneIndex++;
         }
+
+
     }
     else
     {
+
+			copy.boneSequence = boneSequence;
         // Rotate, scale and translate all the vertices,
         const Matrix &rot = shape->trafo->rotation;
         const Vector &pos = shape->trafo->pos;
         float scale = shape->trafo->scale;
+
+		copy.trafo.trans = convertVector3(original.pos);
+		copy.trafo.rotation = convertRotation(original.rotation);
+		copy.trafo.scale = original.scale;
+		//We don't use velocity for anything yet, so it does not need to be saved
+
+		// Computes C = B + AxC*scale
         for (int i=0; i<numVerts; i++)
         {
             vectorMulAdd(rot, pos, ptr, scale);
+			Ogre::Vector3 absVertPos = Ogre::Vector3(*(ptr + 3 * i), *(ptr + 3 * i + 1), *(ptr + 3 * i + 2));
+			mBoundingBox.merge(absVertPos);
             ptr += 3;
         }
 
@@ -735,24 +930,56 @@ void NIFLoader::handleNiTriShape(NiTriShape *shape, int flags, BoundsFinder &bou
                 ptr += 3;
             }
         }
+		if(!mSkel.isNull() ){
+			int boneIndex;
+			
+				boneIndex = mSkel->getNumBones() - 1;
+			for(int i = 0; i < numVerts; i++){
+		 VertexBoneAssignment vba;
+                vba.boneIndex = boneIndex;
+                vba.vertexIndex = i;
+                vba.weight = 1;
+				 vertexBoneAssignments.push_back(vba);
+			}
+		}
     }
 
     if (!hidden)
     {
         // Add this vertex set to the bounding box
         bounds.add(optr, numVerts);
+        if(saveTheShape)
+            shapes.push_back(copy);
 
         // Create the submesh
         createOgreSubMesh(shape, material, vertexBoneAssignments);
     }
 }
 
-void NIFLoader::handleNode(Nif::Node *node, int flags,
-                           const Transformation *trafo, BoundsFinder &bounds, Bone *parentBone)
+void NIFLoader::calculateTransform()
+{
+        // Calculate transform
+        Matrix4 transform = Matrix4::IDENTITY;
+        transform = Matrix4::getScale(vector) * transform;
+
+        // Check whether we have to flip vertex winding.
+        // We do have to, if we changed our right hand base.
+        // We can test it by using the cross product from X and Y and see, if it is a non-negative
+        // projection on Z. Actually it should be exactly Z, as we don't do non-uniform scaling yet,
+        // but the test is cheap either way.
+        Matrix3 m3;
+        transform.extract3x3Matrix(m3);
+
+        if (m3.GetColumn(0).crossProduct(m3.GetColumn(1)).dotProduct(m3.GetColumn(2)) < 0)
+        {
+        	mFlipVertexWinding = true;
+        }
+
+        mTransform = transform;
+}
+void NIFLoader::handleNode(Nif::Node *node, int flags,
+                           const Transformation *trafo, BoundsFinder &bounds, Ogre::Bone *parentBone, std::vector<std::string> boneSequence)
 {
-    stack++;
-    //if( MWClass::isChest)
-    //  cout << "u:" << node << "\n";
     // Accumulate the flags from all the child nodes. This works for all
     // the flags we currently use, at least.
     flags |= node->flags;
@@ -780,6 +1007,58 @@ void NIFLoader::handleNode(Nif::Node *node, int flags,
                 // the engine, just skip this entire node.
                 return;
         }
+
+        if (e->recType == RC_NiTextKeyExtraData){
+            Nif::NiTextKeyExtraData* extra =  dynamic_cast<Nif::NiTextKeyExtraData*> (e);
+
+            std::ofstream file;
+
+            if(mOutputAnimFiles){
+                std::string cut = "";
+                for(unsigned int i = 0; i < name.length();  i++)
+                {
+                    if(!(name.at(i) == '\\' || name.at(i) == '/' || name.at(i) == '>' || name.at(i) == '<' || name.at(i) == '?' || name.at(i) == '*' || name.at(i) == '|' || name.at(i) == ':' || name.at(i) == '"'))
+                    {
+                        cut += name.at(i);
+                    }
+                }
+
+                std::cout << "Outputting " << cut << "\n";
+
+                file.open((verbosePath + "/Indices" + cut + ".txt").c_str());
+            }
+
+            for(std::vector<Nif::NiTextKeyExtraData::TextKey>::iterator textiter = extra->list.begin(); textiter != extra->list.end(); textiter++)
+            {
+                std::string text = textiter->text.toString();
+
+                replace(text.begin(), text.end(), '\n', '/');
+
+                text.erase(std::remove(text.begin(), text.end(), '\r'), text.end());
+                std::size_t i = 0;
+                while(i < text.length()){
+                    while(i < text.length() && text.at(i) == '/' ){
+                        i++;
+                    }
+                    std::size_t first = i;
+                    int length = 0;
+                    while(i < text.length() && text.at(i) != '/' ){
+                        i++;
+                        length++;
+                    }
+                    if(first < text.length()){
+                            //length = text.length() - first;
+                        std::string sub = text.substr(first, length);
+
+                       if(mOutputAnimFiles)
+                            file << "Time: " << textiter->time << "|" << sub << "\n";
+
+                        textmappings[sub] = textiter->time;
+                    }
+                }
+            }
+            file.close();
+        }
     }
 
     Bone *bone = 0;
@@ -790,24 +1069,22 @@ void NIFLoader::handleNode(Nif::Node *node, int flags,
         //FIXME: "Bip01" isn't every time the root bone
         if (node->name == "Bip01" || node->name == "Root Bone")  //root node, create a skeleton
         {
-            mSkel = SkeletonManager::getSingleton().create(getSkeletonName(), resourceGroup, true);
+            inTheSkeletonTree = true;
 
-            /*if (node->extra->recType == RC_NiTextKeyExtraData )
-            {
-                //TODO: Get animation names
-                std::cout << node->name.toString() << " is root bone and has textkeyextradata!\n";
-            }*/
+            mSkel = SkeletonManager::getSingleton().create(getSkeletonName(), resourceGroup, true);
         }
+        else if (!mSkel.isNull() && !parentBone)
+            inTheSkeletonTree = false;
 
         if (!mSkel.isNull())     //if there is a skeleton
         {
             std::string name = node->name.toString();
-            //if (isBeast && isChest)
-            //  std::cout << "NAME: " << name << "\n";
+
             // Quick-n-dirty workaround for the fact that several
             // bones may have the same name.
             if(!mSkel->hasBone(name))
             {
+                boneSequence.push_back(name);
                 bone = mSkel->createBone(name);
 
                 if (parentBone)
@@ -819,7 +1096,7 @@ void NIFLoader::handleNode(Nif::Node *node, int flags,
             }
         }
     }
-
+    Transformation original = *(node->trafo);
     // Apply the parent transformation to this node. We overwrite the
     // existing data with the final transformation.
     if (trafo)
@@ -846,201 +1123,104 @@ void NIFLoader::handleNode(Nif::Node *node, int flags,
     {
         NodeList &list = ((NiNode*)node)->children;
         int n = list.length();
-        int i = 0;
-        if(isHands){
-            //cout << "NumberOfNs: " << n << "Stack:" << stack << "\n";
-            //if(stack == 3)
-                //n=0;
-        }
-        for (; i<n; i++)
+        for (int i = 0; i<n; i++)
         {
 
             if (list.has(i))
-                handleNode(&list[i], flags, node->trafo, bounds, bone);
+                handleNode(&list[i], flags, node->trafo, bounds, bone, boneSequence);
         }
     }
-    else if (node->recType == RC_NiTriShape)
+    else if (node->recType == RC_NiTriShape && bNiTri)
     {
-    // For shapes
-        /*For Beast Skins, Shape Bone Names
-        Tri Left Foot
-        Tri Right Foot
-        Tri Tail
-        Tri Chest
-        */
-        if((isChest && stack < 10 )  || (isHands && counter < 3) || !(isChest || isHands)){                       //(isBeast && isChest && stack < 10 && counter == skincounter )
+         std::string nodename = node->name.toString();
 
-            std::string name = node->name.toString();
-            //if (isChest)
-                //std::cout << "NAME: " << name << "\n";
-
-            if(isChest && isBeast && skincounter == 0 && name.compare("Tri Chest") == 0){
-                //std::cout <<"BEASTCHEST1\n";
-                handleNiTriShape(dynamic_cast<NiTriShape*>(node), flags, bounds);
-                skincounter++;
-            }
-            else if(isChest && isBeast && skincounter == 1 && name.compare("Tri Tail") == 0){
-                //std::cout <<"BEASTCHEST2\n";
-                handleNiTriShape(dynamic_cast<NiTriShape*>(node), flags, bounds);
-                skincounter++;
-            }
-            else if(isChest && isBeast && skincounter == 2 && name.compare("Tri Left Foot") == 0){
-                //std::cout <<"BEASTCHEST3\n";
-                handleNiTriShape(dynamic_cast<NiTriShape*>(node), flags, bounds);
-                skincounter=1000;
-            }
-            else if (!isChest || !isBeast)
+			if (triname == "")
             {
-                handleNiTriShape(dynamic_cast<NiTriShape*>(node), flags, bounds);
+                handleNiTriShape(dynamic_cast<NiTriShape*>(node), flags, bounds, original, boneSequence);
             }
-            //if(isBeast && isChest)
-                //cout << "Handling Shape, Stack " << stack <<"\n";
-
-
-
-                counter++;
-        }
-        /*if(isHands){
-            //cout << "Handling Shape, Stack " << stack <<"\n";
-            counter++;
-        }*/
-
+			else if(nodename.length() >= triname.length())
+			{
+				std::transform(nodename.begin(), nodename.end(), nodename.begin(), ::tolower);
+				if(triname == nodename.substr(0, triname.length()))
+					handleNiTriShape(dynamic_cast<NiTriShape*>(node), flags, bounds, original, boneSequence);
+			}
     }
-
-    stack--;
 }
 
 void NIFLoader::loadResource(Resource *resource)
 {
-    if(skincounter == 1000)
-        skincounter = 0;
-    stack = 0;
-    counter = 0;
-    std::string name = resource->getName();
-    if(resourceName.compare(name) != 0)
-    {
-        skincounter = 0;
-        resourceName = name;
-    }
-    //std::cout <<"NAME:" << name;
-    //if(name.length() >= 20)
-    //  {std::string split = name.substr(name.length() - 20, 20);
-    //if(name ==
-    //std::cout <<"NAME:" << name << "LEN: " << name.length() << "\n";
-    const std::string test ="meshes\\b\\B_N_Dark Elf_M_Skins.NIF";
-    const std::string test2 ="meshes\\b\\B_N_Dark Elf_M_Skins.nif";
-    const std::string test3 ="meshes\\b\\B_N_Redguard_F_Skins.NIF";
-    const std::string test4 ="meshes\\b\\B_N_Redguard_F_Skins.nif";
-    const std::string test5 ="meshes\\b\\B_N_Dark Elf_F_Skins.nif";
-    const std::string test6 ="meshes\\b\\B_N_Redguard_M_Skins.nif";
-    const std::string test7 ="meshes\\b\\B_N_Wood Elf_F_Skins.nif";
-    const std::string test8 ="meshes\\b\\B_N_Wood Elf_M_Skins.nif";
-    const std::string test9 ="meshes\\b\\B_N_Imperial_F_Skins.nif";
-    const std::string test10 ="meshes\\b\\B_N_Imperial_M_Skins.nif";
-    const std::string test11 ="meshes\\b\\B_N_Khajiit_F_Skins.nif";
-    const std::string test12 ="meshes\\b\\B_N_Khajiit_M_Skins.nif";
-    const std::string test13 ="meshes\\b\\B_N_Argonian_F_Skins.nif";
-    const std::string test14 ="meshes\\b\\B_N_Argonian_M_Skins.nif";
-    const std::string test15 ="meshes\\b\\B_N_Nord_F_Skins.nif";
-    const std::string test16 ="meshes\\b\\B_N_Nord_M_Skins.nif";
-    const std::string test17 ="meshes\\b\\B_N_Imperial_F_Skins.nif";
-    const std::string test18 ="meshes\\b\\B_N_Imperial_M_Skins.nif";
-    const std::string test19 ="meshes\\b\\B_N_Orc_F_Skins.nif";
-    const std::string test20 ="meshes\\b\\B_N_Orc_M_Skins.nif";
-    const std::string test21 ="meshes\\b\\B_N_Breton_F_Skins.nif";
-    const std::string test22 ="meshes\\b\\B_N_Breton_M_Skins.nif";
-    const std::string test23 ="meshes\\b\\B_N_High Elf_F_Skins.nif";
-    const std::string test24 ="meshes\\b\\B_N_High Elf_M_Skins.nif";
-
-    //std::cout <<"LEN1:" << test.length() << "TEST: " << test << "\n";
-
-
-    if(name.compare(test) == 0 || name.compare(test2) == 0 || name.compare(test3) == 0 || name.compare(test4) == 0 ||
-        name.compare(test5) == 0 || name.compare(test6) == 0 || name.compare(test7) == 0 || name.compare(test8) == 0 || name.compare(test9) == 0 ||
-        name.compare(test10) == 0 || name.compare(test11) == 0 || name.compare(test12) == 0 || name.compare(test13) == 0 ||
-        name.compare(test14) == 0 || name.compare(test15) == 0 || name.compare(test16) == 0 || name.compare(test17) == 0 ||
-        name.compare(test18) == 0 || name.compare(test19) == 0 || name.compare(test20) == 0 || name.compare(test21) == 0 ||
-        name.compare(test22) == 0 || name.compare(test23) == 0 || name.compare(test24) == 0
-
-        ){
-        //std::cout << "Welcome Chest\n";
-        isChest = true;
-        if(name.compare(test11) == 0 || name.compare(test12) == 0 || name.compare(test13) == 0 || name.compare(test14) == 0)
-        {
-            isBeast = true;
-            //std::cout << "Welcome Beast\n";
-        }
-        else
-            isBeast = false;
-    }
-    else
-        isChest = false;
-    const std::string hands ="meshes\\b\\B_N_Dark Elf_M_Hands.1st.NIF";
-    const std::string hands2 ="meshes\\b\\B_N_Dark Elf_F_Hands.1st.NIF";
-    const std::string hands3 ="meshes\\b\\B_N_Redguard_M_Hands.1st.nif";
-    const std::string hands4 ="meshes\\b\\B_N_Redguard_F_Hands.1st.nif";
-    const std::string hands5 ="meshes\\b\\b_n_argonian_m_hands.1st.nif";
-    const std::string hands6 ="meshes\\b\\b_n_argonian_f_hands.1st.nif";
-    const std::string hands7 ="meshes\\b\\B_N_Breton_M_Hand.1st.NIF";
-    const std::string hands8 ="meshes\\b\\B_N_Breton_F_Hands.1st.nif";
-    const std::string hands9 ="meshes\\b\\B_N_High Elf_M_Hands.1st.nif";
-    const std::string hands10 ="meshes\\b\\B_N_High Elf_F_Hands.1st.nif";
-    const std::string hands11 ="meshes\\b\\B_N_Nord_M_Hands.1st.nif";
-    const std::string hands12 ="meshes\\b\\B_N_Nord_F_Hands.1st.nif";
-    const std::string hands13 ="meshes\\b\\b_n_khajiit_m_hands.1st.nif";
-    const std::string hands14 ="meshes\\b\\b_n_khajiit_f_hands.1st.nif";
-    const std::string hands15 ="meshes\\b\\B_N_Orc_M_Hands.1st.nif";
-    const std::string hands16 ="meshes\\b\\B_N_Orc_F_Hands.1st.nif";
-    const std::string hands17 ="meshes\\b\\B_N_Wood Elf_M_Hands.1st.nif";
-    const std::string hands18 ="meshes\\b\\B_N_Wood Elf_F_Hands.1st.nif";
-    const std::string hands19 ="meshes\\b\\B_N_Imperial_M_Hands.1st.nif";
-    const std::string hands20 ="meshes\\b\\B_N_Imperial_F_Hands.1st.nif";
-    if(name.compare(hands) == 0 || name.compare(hands2) == 0 || name.compare(hands3) == 0 || name.compare(hands4) == 0 ||
-        name.compare(hands5) == 0 || name.compare(hands6) == 0 || name.compare(hands7) == 0 || name.compare(hands8) == 0 ||
-        name.compare(hands9) == 0 || name.compare(hands10) == 0 || name.compare(hands11) == 0 || name.compare(hands12) == 0 ||
-        name.compare(hands13) == 0 || name.compare(hands14) == 0 || name.compare(hands15) == 0 || name.compare(hands16) == 0 ||
-        name.compare(hands17) == 0 || name.compare(hands18) == 0 || name.compare(hands19) == 0 || name.compare(hands20) == 0)
-    {
-        //std::cout << "Welcome Hands1st\n";
-        isHands = true;
-        isChest = false;
-    }
-    else
-        isHands = false;
-
-
-    /*
-    else if(name.compare(test3) == 0 || name.compare(test4) == 0)
-    {
-        std::cout << "\n\n\nWelcome FRedguard Chest\n\n\n";
-        isChest = true;
-    }
-    else if(name.compare(test5) == 0 || name.compare(test6) == 0)
-    {
-        std::cout << "\n\n\nWelcome FRedguard Chest\n\n\n";
-        isChest = true;
-    }
-    else if(name.compare(test7) == 0 || name.compare(test8) == 0)
-    {
-        std::cout << "\n\n\nWelcome FRedguard Chest\n\n\n";
-        isChest = true;
-    }
-    else if(name.compare(test9) == 0 || name.compare(test10) == 0)
-    {
-        std::cout << "\n\n\nWelcome FRedguard Chest\n\n\n";
-        isChest = true;
-    }*/
-
-    //if(split== "Skins.NIF")
-    //  std::cout << "\nSPECIAL PROPS\n";
-    resourceName = "";
-    // Check if the resource already exists
-    //MeshPtr ptr = m->load(name, "custom");
-    //cout << "THISNAME: " << ptr->getName() << "\n";
-    //cout << "RESOURCE:"<< resource->getName();
+    inTheSkeletonTree = false;
+    	allanim.clear();
+	shapes.clear();
+    needBoneAssignments.clear();
+   // needBoneAssignments.clear();
+   mBoundingBox.setNull();
     mesh = 0;
     mSkel.setNull();
+    flip = false;
+    name = resource->getName();
+    char suffix = name.at(name.length() - 2);
+    bool addAnim = true;
+    bool hasAnim = false;
+    //bool baddin = false;
+    bNiTri = true;
+    if(name == "meshes\\base_anim.nif" || name == "meshes\\base_animkna.nif")
+    {
+        bNiTri = false;
+    }
 
+        if(suffix == '*')
+		{
+			vector = Ogre::Vector3(-1,1,1);
+			flip = true;
+		}
+		else if(suffix == '?'){
+			vector = Ogre::Vector3(1,-1,1);
+			flip = true;
+		}
+		else if(suffix == '<'){
+			vector = Ogre::Vector3(1,1,-1);
+			flip = true;
+		}
+		else if(suffix == '>')
+		{
+            //baddin = true;
+			bNiTri = true;
+			std::string sub = name.substr(name.length() - 6, 4);
+
+			if(sub.compare("0000") != 0)
+			addAnim = false;
+
+		}
+
+       switch(name.at(name.length() - 1))
+	{
+	    case '"':
+			triname = "tri chest";
+			break;
+		case '*':
+			triname = "tri tail";
+			break;
+		case ':':
+			triname = "tri left foot";
+			break;
+		case '<':
+			triname = "tri right foot";
+			break;
+		case '>':
+			triname = "tri left hand";
+			break;
+		case '?':
+			triname = "tri right hand";
+			break;
+		default:
+			triname = "";
+			break;
+	}
+    if(flip)
+	{
+		calculateTransform();
+	}
     // Set up the VFS if it hasn't been done already
     if (!vfs) vfs = new OgreVFS(resourceGroup);
 
@@ -1087,8 +1267,33 @@ void NIFLoader::loadResource(Resource *resource)
     }
 
     // Handle the node
-    handleNode(node, 0, NULL, bounds, 0);
+	std::vector<std::string> boneSequence;
 
+
+
+    handleNode(node, 0, NULL, bounds, 0, boneSequence);
+    if(addAnim)
+    {
+        for(int i = 0; i < nif.numRecords(); i++)
+        {
+            Nif::NiKeyframeController *f = dynamic_cast<Nif::NiKeyframeController*>(nif.getRecord(i));
+
+            if(f != NULL)
+            {
+                hasAnim = true;
+                Nif::Node *o = dynamic_cast<Nif::Node*>(f->target.getPtr());
+                Nif::NiKeyframeDataPtr data = f->data;
+
+                if (f->timeStart >= 10000000000000000.0f)
+                    continue;
+                data->setBonename(o->name.toString());
+                data->setStartTime(f->timeStart);
+                data->setStopTime(f->timeStop);
+
+                allanim.push_back(data.get());
+            }
+        }
+    }
     // set the bounding value.
     if (bounds.isValid())
     {
@@ -1096,64 +1301,93 @@ void NIFLoader::loadResource(Resource *resource)
                                         bounds.maxX(), bounds.maxY(), bounds.maxZ()));
         mesh->_setBoundingSphereRadius(bounds.getRadius());
     }
+    if(hasAnim && addAnim){
+        allanimmap[name] = allanim;
+        alltextmappings[name] = textmappings;
+    }
+    if(!mSkel.isNull() && shapes.size() > 0 && addAnim)
+    {
+        allshapesmap[name] = shapes;
 
-    // set skeleton
-//     if (!skel.isNull())
-//         mesh->setSkeletonName(getSkeletonName());
+    }
+
+    if(flip){
+        mesh->_setBounds(mBoundingBox, false);
+    }
+
+     if (!mSkel.isNull() )
+    {
+        for(std::vector<Ogre::SubMesh*>::iterator iter = needBoneAssignments.begin(); iter != needBoneAssignments.end(); iter++)
+        {
+            int boneIndex = mSkel->getNumBones() - 1;
+		        VertexBoneAssignment vba;
+                vba.boneIndex = boneIndex;
+                vba.vertexIndex = 0;
+                vba.weight = 1;
+				 
+
+            (*iter)->addBoneAssignment(vba);
+        }
+       mesh->_notifySkeleton(mSkel);
+    }
 }
 
+
+
+
+
 MeshPtr NIFLoader::load(const std::string &name,
                          const std::string &group)
 {
+
     MeshManager *m = MeshManager::getSingletonPtr();
     // Check if the resource already exists
     ResourcePtr ptr = m->getByName(name, group);
-    MeshPtr resize;
-
-    const std::string beast1 ="meshes\\b\\B_N_Khajiit_F_Skins.nif";
-    const std::string beast2 ="meshes\\b\\B_N_Khajiit_M_Skins.nif";
-    const std::string beast3 ="meshes\\b\\B_N_Argonian_F_Skins.nif";
-    const std::string beast4 ="meshes\\b\\B_N_Argonian_M_Skins.nif";
-
-    const std::string beasttail1 ="tail\\b\\B_N_Khajiit_F_Skins.nif";
-    const std::string beasttail2 ="tail\\b\\B_N_Khajiit_M_Skins.nif";
-    const std::string beasttail3 ="tail\\b\\B_N_Argonian_F_Skins.nif";
-    const std::string beasttail4 ="tail\\b\\B_N_Argonian_M_Skins.nif";
-
+    MeshPtr themesh;
     if (!ptr.isNull()){
-
-        //if(pieces > 1)
-            //cout << "It exists\n";
-            resize = MeshPtr(ptr);
-        //resize->load();
-        //resize->reload();
+            themesh = MeshPtr(ptr);
     }
     else // Nope, create a new one.
     {
-        resize = MeshManager::getSingleton().createManual(name, group, NIFLoader::getSingletonPtr());
-        //cout <<"EXISTING" << name << "\n";
-
-        //if(pieces > 1)
-            //cout << "Creating it\n";
-
-
-        //resize->load();
-        //resize->reload();
-        //return 0;
-         ResourcePtr ptr = m->getByName(name, group);
-         resize = MeshPtr(ptr);
-
-        //NIFLoader::getSingletonPtr()->
-        /*ResourcePtr ptr = m->getByName(name, group);
-    if (!ptr.isNull()){
-        if(pieces > 1)
-            cout << "It exists\n";
-        resize = MeshPtr(ptr);*/
-        //return resize;
+        themesh = MeshManager::getSingleton().createManual(name, group, NIFLoader::getSingletonPtr());
     }
-    return resize;
+    return themesh;
 }
 
+/*
+This function shares much of the same code handleShapes() in MWRender::Animation
+This function also creates new position and normal buffers for submeshes.
+This function points to existing texture and IndexData buffers
+*/
+
+std::vector<Nif::NiKeyframeData>* NIFLoader::getAnim(std::string lowername){
+
+        std::map<std::string,std::vector<Nif::NiKeyframeData>,ciLessBoost>::iterator iter = allanimmap.find(lowername);
+       std::vector<Nif::NiKeyframeData>* pass = 0;
+        if(iter != allanimmap.end())
+            pass = &(iter->second);
+        return pass;
+
+}
+std::vector<Nif::NiTriShapeCopy>* NIFLoader::getShapes(std::string lowername){
+
+        std::map<std::string,std::vector<Nif::NiTriShapeCopy>,ciLessBoost>::iterator iter = allshapesmap.find(lowername);
+        std::vector<Nif::NiTriShapeCopy>* pass = 0;
+        if(iter != allshapesmap.end())
+            pass = &(iter->second);
+        return pass;
+}
+
+std::map<std::string, float>* NIFLoader::getTextIndices(std::string lowername){
+	std::map<std::string,std::map<std::string, float>, ciLessBoost>::iterator iter = alltextmappings.find(lowername);
+    std::map<std::string, float>* pass = 0;
+		if(iter != alltextmappings.end())
+			pass = &(iter->second);
+		return pass;
+}
+
+
+
 
 /* More code currently not in use, from the old D source. This was
    used in the first attempt at loading NIF meshes, where each submesh
diff --git a/components/nifogre/ogre_nif_loader.hpp b/components/nifogre/ogre_nif_loader.hpp
index bf8a94266f..794459e469 100644
--- a/components/nifogre/ogre_nif_loader.hpp
+++ b/components/nifogre/ogre_nif_loader.hpp
@@ -28,10 +28,38 @@
 #include <OgreMesh.h>
 #include <assert.h>
 #include <string>
+#include    <boost/algorithm/string.hpp>
+#include <Ogre.h>
+#include <stdio.h>
+#include <iostream>
+
+#include <libs/mangle/vfs/servers/ogre_vfs.hpp>
+#include "../nif/nif_file.hpp"
+#include "../nif/node.hpp"
+#include "../nif/data.hpp"
+#include "../nif/property.hpp"
+#include "../nif/controller.hpp"
+#include "../nif/extra.hpp"
+#include <libs/platform/strings.h>
+
+#include <vector>
+#include <list>
+// For warning messages
+#include <iostream>
+#include <limits>
+using namespace boost::algorithm;
 
 
 class BoundsFinder;
 
+struct ciLessBoost : std::binary_function<std::string, std::string, bool>
+{
+    bool operator() (const std::string & s1, const std::string & s2) const {
+                                               //case insensitive version of is_less
+        return lexicographical_compare(s1, s2, is_iless());
+    }
+};
+
 namespace Nif
 {
     class Node;
@@ -52,6 +80,7 @@ namespace Mangle
 namespace NifOgre
 {
 
+
 /** Manual resource loader for NIF meshes. This is the main class
     responsible for translating the internal NIF mesh structure into
     something Ogre can use. Later it will also handle the insertion of
@@ -78,23 +107,34 @@ class NIFLoader : Ogre::ManualResourceLoader
 
         static Ogre::MeshPtr load(const std::string &name,
                                     const std::string &group="General");
-
+        //void insertMeshInsideBase(Ogre::Mesh* mesh);
+        std::vector<Nif::NiKeyframeData>* getAnim(std::string name);
+        std::vector<Nif::NiTriShapeCopy>* getShapes(std::string name);
+        std::map<std::string, float>* getTextIndices(std::string name);
 
 
         Ogre::Vector3 convertVector3(const Nif::Vector& vec);
         Ogre::Quaternion convertRotation(const Nif::Matrix& rot);
 
+        void setOutputAnimFiles(bool output);
+        void setVerbosePath(std::string path);
+
     private:
-        NIFLoader() : resourceGroup("General") { skincounter = 0; resourceName = "";}
+
+        NIFLoader() : resourceName(""), resourceGroup("General"),  flip(false), mNormaliseNormals(false),
+          mFlipVertexWinding(false), mOutputAnimFiles(false), inTheSkeletonTree(false)  {}
         NIFLoader(NIFLoader& n) {}
 
+        void calculateTransform();
+
+
         void warn(std::string msg);
         void fail(std::string msg);
 
         void handleNode( Nif::Node *node, int flags,
-                        const Nif::Transformation *trafo, BoundsFinder &bounds, Ogre::Bone *parentBone);
+                        const Nif::Transformation *trafo, BoundsFinder &bounds, Ogre::Bone *parentBone, std::vector<std::string> boneSequence);
 
-        void handleNiTriShape(Nif::NiTriShape *shape, int flags, BoundsFinder &bounds);
+        void handleNiTriShape(Nif::NiTriShape *shape, int flags, BoundsFinder &bounds, Nif::Transformation original, std::vector<std::string> boneSequence);
 
         void createOgreSubMesh(Nif::NiTriShape *shape, const Ogre::String &material, std::list<Ogre::VertexBoneAssignment> &vertexBoneAssignments);
 
@@ -124,21 +164,37 @@ class NIFLoader : Ogre::ManualResourceLoader
         // extension from .tga to .dds if the texture is missing.
         Mangle::VFS::OgreVFS *vfs;
 
+        std::string verbosePath;
         std::string resourceName;
         std::string resourceGroup;
-        int skincounter;
-        bool isChest;
-        bool isBeast;
-        bool isHands;
-        bool isFeet;
-        int counter;
-        int numbers;
-        int stack;
+        Ogre::Matrix4 mTransform;
+        Ogre::AxisAlignedBox mBoundingBox;
+        bool flip;
+        bool mNormaliseNormals;
+        bool mFlipVertexWinding;
+        bool bNiTri;
+        bool mOutputAnimFiles;
         std::multimap<std::string,std::string> MaterialMap;
 
         // pointer to the ogre mesh which is currently build
         Ogre::Mesh *mesh;
         Ogre::SkeletonPtr mSkel;
+        Ogre::Vector3 vector;
+        std::vector<Nif::NiTriShapeCopy> shapes;
+        std::string name;
+        std::string triname;
+        std::vector<Nif::NiKeyframeData> allanim;
+
+		std::map<std::string,float> textmappings;
+		std::map<std::string,std::map<std::string,float>,ciLessBoost> alltextmappings;
+		std::map<std::string,std::vector<Nif::NiKeyframeData>,ciLessBoost> allanimmap;
+		std::map<std::string,std::vector<Nif::NiTriShapeCopy>,ciLessBoost> allshapesmap;
+        std::vector<Nif::NiKeyframeData> mAnim;
+		std::vector<Nif::NiTriShapeCopy> mS;
+        std::vector<Ogre::SubMesh*> needBoneAssignments;
+        bool inTheSkeletonTree;
+        
+
 };
 
 }
diff --git a/extern/caelum/CMakeLists.txt b/extern/caelum/CMakeLists.txt
deleted file mode 100755
index b747fefc8e..0000000000
--- a/extern/caelum/CMakeLists.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-project(Caelum)
-
-IF(MSVC)
-    add_definitions("-D_SCL_SECURE_NO_WARNINGS /wd4305 /wd4244" )
-ENDIF(MSVC)
-
-ADD_DEFINITIONS(-DCAELUM_STATIC)
-INCLUDE_DIRECTORIES( 
-    ${CMAKE_HOME_DIRECTORY}/extern/caelum/include 
-    ${OGRE_INCLUDE_DIR}/Ogre
-    )    
-
-file(GLOB_RECURSE CAELUM_SRC src/*)
-file(GLOB_RECURSE CAELUM_HDR include/*)
-
-set(SOURCES ${CAELUM_SRC} ${CAELUM_HDR})
-add_library(caelum STATIC ${SOURCES})
-
-#
-# Resources
-#
-SET(CAELUM_RES_DEST "${OpenMW_BINARY_DIR}")
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/AtmosphereDepth.png "${CAELUM_RES_DEST}/resources/caelum/AtmosphereDepth.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumGroundFog.cg "${CAELUM_RES_DEST}/resources/caelum/CaelumGroundFog.cg" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumLayeredClouds.cg "${CAELUM_RES_DEST}/resources/caelum/CaelumLayeredClouds.cg" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumPhaseMoon.cg "${CAELUM_RES_DEST}/resources/caelum/CaelumPhaseMoon.cg" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumPointStarfield.cg "${CAELUM_RES_DEST}/resources/caelum/CaelumPointStarfield.cg" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CaelumSkyDome.cg "${CAELUM_RES_DEST}/resources/caelum/CaelumSkyDome.cg" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/CloudCoverLookup.png "${CAELUM_RES_DEST}/resources/caelum/CloudCoverLookup.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthComposer.cg "${CAELUM_RES_DEST}/resources/caelum/DepthComposer.cg" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthComposer.compositor "${CAELUM_RES_DEST}/resources/caelum/DepthComposer.compositor" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthComposer.material "${CAELUM_RES_DEST}/resources/caelum/DepthComposer.material" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/DepthRender.program "${CAELUM_RES_DEST}/resources/caelum/DepthRender.program" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/EarthClearSky2.png "${CAELUM_RES_DEST}/resources/caelum/EarthClearSky2.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/GroundFog.material "${CAELUM_RES_DEST}/resources/caelum/GroundFog.material" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/GroundFog.program "${CAELUM_RES_DEST}/resources/caelum/GroundFog.program" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Haze.program "${CAELUM_RES_DEST}/resources/caelum/Haze.program" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/LayeredClouds.material "${CAELUM_RES_DEST}/resources/caelum/LayeredClouds.material" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/MinimalCompositorVP.cg "${CAELUM_RES_DEST}/resources/caelum/MinimalCompositorVP.cg" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/MinimalCompositorVP.program "${CAELUM_RES_DEST}/resources/caelum/MinimalCompositorVP.program" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/moon.material "${CAELUM_RES_DEST}/resources/caelum/moon.material" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/moon_disc.dds "${CAELUM_RES_DEST}/resources/caelum/moon_disc.dds" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise1.dds "${CAELUM_RES_DEST}/resources/caelum/noise1.dds" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise2.dds "${CAELUM_RES_DEST}/resources/caelum/noise2.dds" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise3.dds "${CAELUM_RES_DEST}/resources/caelum/noise3.dds" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/noise4.dds "${CAELUM_RES_DEST}/resources/caelum/noise4.dds" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/PointStarfield.material "${CAELUM_RES_DEST}/resources/caelum/PointStarfield.material" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Precipitation.cg "${CAELUM_RES_DEST}/resources/caelum/Precipitation.cg" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Precipitation.compositor "${CAELUM_RES_DEST}/resources/caelum/Precipitation.compositor" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Precipitation.material "${CAELUM_RES_DEST}/resources/caelum/Precipitation.material" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_drizzle.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_drizzle.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_hail.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_hail.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_icecrystals.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_icecrystals.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_icepellets.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_icepellets.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_rain.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_rain.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_smallhail.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_smallhail.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_snow.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_snow.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/precipitation_snowgrains.png "${CAELUM_RES_DEST}/resources/caelum/precipitation_snowgrains.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/SkyDome.material "${CAELUM_RES_DEST}/resources/caelum/SkyDome.material" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/sphere.mesh "${CAELUM_RES_DEST}/resources/caelum/sphere.mesh" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Starfield.jpg "${CAELUM_RES_DEST}/resources/caelum/Starfield.jpg" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Starfield.material "${CAELUM_RES_DEST}/resources/caelum/Starfield.material" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/Sun.material "${CAELUM_RES_DEST}/resources/caelum/Sun.material" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/SunGradient.png "${CAELUM_RES_DEST}/resources/caelum/SunGradient.png" COPYONLY)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/sun_disc.png "${CAELUM_RES_DEST}/resources/caelum/sun_disc.png" COPYONLY)
diff --git a/extern/caelum/include/Astronomy.h b/extern/caelum/include/Astronomy.h
deleted file mode 100644
index ed7d972cb8..0000000000
--- a/extern/caelum/include/Astronomy.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__ASTRONOMY_H
-#define CAELUM__ASTRONOMY_H
-
-#include "CaelumPrerequisites.h"
-
-namespace Caelum
-{
-    /** Static class with astronomy routines.
-     *  This class contains various astronomical routines useful in Caelum.
-     *
-     *  Most of the formulas are from http://stjarnhimlen.se/comp/ppcomp.html
-     *  That site contains much more than was implemented here; it has code
-     *  for determining the positions of all the planets. Only the sun and
-     *  moon are actually useful for caelum.
-     *
-     *  The formulas are isolated here in pure procedural code for easier
-     *  testing (Tests are done as assertions in the demo).
-     *
-     *  Precision is vital here, so this class uses Caelum::LongReal(double)
-     *  instead of Ogre::Real(float) for precission. All angles are in degrees
-     *  unless otherwise mentioned. Ogre::Degree and Ogre::Radian use
-     *  Ogre::Real and should be avoided here.
-     */
-    class CAELUM_EXPORT Astronomy
-    {
-    private:
-        Astronomy() {}
-
-        static const LongReal PI;
-
-        /** Normalize an angle to the 0, 360 range.
-         *  @param x The angle to normalize
-         */
-        static LongReal normalizeDegrees (LongReal x);
-
-        /// Convert radians to degrees.
-        static LongReal radToDeg (LongReal x);
-
-        /// Convert degrees to radians.
-        static LongReal degToRad (LongReal x);
-
-        static LongReal sinDeg (LongReal x);
-        static LongReal cosDeg (LongReal x);
-        static LongReal atan2Deg (LongReal y, LongReal x);
-
-    public:
-        /// January 1, 2000, noon
-        static const LongReal J2000;
-
-        /** Convert from ecliptic to ecuatorial spherical coordinates, in radians.
-         *  @param lon Ecliptic longitude
-         *  @param lat Ecliptic latitude
-         *  @param rasc Right ascension
-         *  @param decl Declination
-         *  @warning: This function works in radians.
-         */
-		static void convertEclipticToEquatorialRad (
-                LongReal lon, LongReal lat,
-                LongReal& rasc, LongReal& decl);
-
-		static void convertRectangularToSpherical (
-                LongReal x, LongReal y, LongReal z,
-                LongReal &rasc, LongReal &decl, LongReal &dist);
-
-        static void convertSphericalToRectangular (
-                LongReal rasc, LongReal decl, LongReal dist,
-                LongReal &x, LongReal &y, LongReal &z);
-
-        /** Convert from equatorial to horizontal coordinates.
-         *  This function converts from angles relative to the earth's equator
-         *  to angle relative to the horizon at a given point.
-         *  @param jday Astronomical time as julian day.
-         *  @param longitude Observer's longitude in degrees east.
-         *  @param latitude Observer's latitude in degrees north.
-         *  @param rasc Object's right ascension.
-         *  @param decl Object's declination.
-         *  @param azimuth Object's azimuth (clockwise degrees from true north).
-         *  @param altitude Object's altitude (degrees above the horizon).
-         */
-        static void convertEquatorialToHorizontal (
-                LongReal jday,
-                LongReal longitude, LongReal latitude,
-                LongReal rasc,      LongReal decl,
-                LongReal &azimuth,  LongReal &altitude);
-
-        /** Get the sun's position in the sky in, relative to the horizon.
-         *  @param jday Astronomical time as julian day.
-         *  @param longitude Observer longitude
-         *  @param latitude Observer latitude
-         *  @param azimuth Astronomical azimuth, measured clockwise from North = 0.
-         *  @param altitude Astronomical altitude, elevation above the horizon.
-         */
-        static void getHorizontalSunPosition (
-                LongReal jday,
-                LongReal longitude, LongReal latitude,
-                LongReal &azimuth, LongReal &altitude);
-
-        static void getHorizontalSunPosition (
-                LongReal jday,
-                Ogre::Degree longitude, Ogre::Degree latitude,
-                Ogre::Degree &azimuth, Ogre::Degree &altitude);
-
-        /// Gets the moon position at a specific time in ecliptic coordinates
-        /// @param lon: Ecliptic longitude, in radians.
-        /// @param lat: Ecliptic latitude, in radians.
-		static void getEclipticMoonPositionRad (
-                LongReal jday,
-                LongReal &lon,
-                LongReal &lat);
-
-        static void getHorizontalMoonPosition (
-                LongReal jday,
-                LongReal longitude, LongReal latitude,
-                LongReal &azimuth, LongReal &altitude);
-		static void getHorizontalMoonPosition (
-                LongReal jday,
-                Ogre::Degree longitude, Ogre::Degree latitude,
-                Ogre::Degree &azimuth, Ogre::Degree &altitude);
-
-        /** Get astronomical julian day from normal gregorian calendar.
-         *  From wikipedia: the integer number of days that have elapsed
-         *  since the initial epoch defined as
-         *  noon Universal Time (UT) Monday, January 1, 4713 BC
-         *  @note this is the time at noon, not midnight.
-         */
-        static int getJulianDayFromGregorianDate (
-                int year, int month, int day); 
-
-        /** Get astronomical julian day from normal gregorian calendar.
-         *  Calculate julian day from a day in the normal gregorian calendar.
-         *  Time should be given as UTC.
-         *  @see http://en.wikipedia.org/wiki/Julian_day
-         */
-        static LongReal getJulianDayFromGregorianDateTime (
-                int year, int month, int day,
-                int hour, int minute, LongReal second); 
-
-        /** Get astronomical julian day from normal gregorian calendar.
-         *  @see above (I don't know the proper doxygen syntax).
-         */
-        static LongReal getJulianDayFromGregorianDateTime (
-                int year, int month, int day,
-                LongReal secondsFromMidnight); 
-
-        /// Get gregorian date from integer julian day.
-        static void getGregorianDateFromJulianDay (
-                int julianDay, int &year, int &month, int &day);
-
-        /// Get gregorian date time from floating point julian day.
-        static void getGregorianDateTimeFromJulianDay (
-                LongReal julianDay, int &year, int &month, int &day,
-                int &hour, int &minute, LongReal &second);
-
-        /// Get gregorian date from floating point julian day.
-        static void getGregorianDateFromJulianDay (
-                LongReal julianDay, int &year, int &month, int &day);
-
-        /** Enter high-precission floating-point mode.
-         *
-         *  By default Direct3D decreases the precission of ALL floating
-         *  point calculations, enough to stop Caelum's astronomy routines
-         *  from working correctly.
-         *  
-         *  To trigger this behaviour in a standard ogre demo select the
-         *  Direct3D render system and set "Floating-point mode" to
-         *  "Fastest". Otherwise it's not a problem.
-         *          
-         *  It can be fixed by changing the precission only inside caelum's
-         *  astronomy routines using the _controlfp function. This only works
-         *  for MSVC on WIN32; This is a no-op on other compilers.
-         *
-         *  @note: Must be paired with restoreFloatingPointMode.
-         *  @return Value to pass to restoreFloatingModeMode.
-         */
-        static int enterHighPrecissionFloatingPointMode ();
-
-        /** Restore old floating point precission.
-         *  @see enterHighPrecissionFloatingPointMode.
-         */
-        static void restoreFloatingPointMode (int oldMode);
-    };
-
-    /** Dummy class to increase floting point precission in a block
-     *  This class will raise precission in the ctor and restore it
-     *  in the destructor. During it's lifetime floating-point
-     *  precission will be increased.
-     *
-     *  To use this class just create a instance on the stack at the start of a block.
-     *
-     *  @see Astronomy::enterHighPrecissionFloatingPointMode
-     */ 
-    class CAELUM_EXPORT ScopedHighPrecissionFloatSwitch
-    {
-    private:
-        int mOldFpMode;
-
-    public:
-        inline ScopedHighPrecissionFloatSwitch() {
-            mOldFpMode = Astronomy::enterHighPrecissionFloatingPointMode ();
-        }
-
-        inline ~ScopedHighPrecissionFloatSwitch() {
-            Astronomy::restoreFloatingPointMode (mOldFpMode);
-        }
-    };
-}
-
-#endif // CAELUM__ASTRONOMY_H
diff --git a/extern/caelum/include/Caelum.h b/extern/caelum/include/Caelum.h
deleted file mode 100644
index 56eabeb878..0000000000
--- a/extern/caelum/include/Caelum.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM_H
-#define CAELUM_H
-
-#include "CaelumPrerequisites.h"
-#include "CaelumScriptTranslator.h"
-#include "TypeDescriptor.h"
-#include "CaelumPlugin.h"
-#include "CaelumExceptions.h"
-#include "CaelumSystem.h"
-#include "CameraBoundElement.h"
-#include "SkyDome.h"
-#include "Sun.h"
-#include "Moon.h"
-#include "UniversalClock.h"
-#include "Astronomy.h"
-#include "CloudSystem.h"
-#include "PrecipitationController.h"
-#include "FlatCloudLayer.h"
-#include "ImageStarfield.h"
-#include "PointStarfield.h"
-#include "GroundFog.h"
-#include "DepthComposer.h"
-
-#endif // CAELUM_H
diff --git a/extern/caelum/include/CaelumExceptions.h b/extern/caelum/include/CaelumExceptions.h
deleted file mode 100644
index 7e00297d19..0000000000
--- a/extern/caelum/include/CaelumExceptions.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__CAELUM_EXCEPTIONS_H
-#define CAELUM__CAELUM_EXCEPTIONS_H
-
-#include "CaelumPrerequisites.h"
-
-namespace Caelum
-{
-    /** Exception class for unsupported features.
-     *  This is frequently thrown if a certain required material does not load;
-     *  most likely because the hardware does not support the required shaders.
-     */
-    class CAELUM_EXPORT UnsupportedException : public Ogre::Exception
-    {
-    public:
-        /// Constructor.
-        UnsupportedException
-        (
-                int number,
-                const Ogre::String &description,
-                const Ogre::String &source,
-                const char *file,
-                long line
-        ):
-                Ogre::Exception (number, description, source, "UnsupportedException", file, line)
-        {
-        }
-    };
-
-#define CAELUM_THROW_UNSUPPORTED_EXCEPTION(desc, src) \
-        throw UnsupportedException(-1, (desc), (src), __FILE__, __LINE__);
-
-}
-
-#endif // CAELUM__CAELUM_EXCEPTIONS_H
diff --git a/extern/caelum/include/CaelumPlugin.h b/extern/caelum/include/CaelumPlugin.h
deleted file mode 100644
index 4542866577..0000000000
--- a/extern/caelum/include/CaelumPlugin.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__CAELUM_PLUGIN_H
-#define CAELUM__CAELUM_PLUGIN_H
-
-#include "CaelumPrerequisites.h"
-#include "CaelumScriptTranslator.h"
-#include "TypeDescriptor.h"
-#include "OgrePlugin.h"
-
-namespace Caelum
-{
-    /** Implement an Ogre::Plugin for Caelum.
-     *
-     *  Ogre plugins are usually loaded from config files and they register
-     *  various stuff in ogre managers. But you can also just link to the
-     *  library normally and call install functions manually.
-     */
-    class CAELUM_EXPORT CaelumPlugin: public Ogre::Singleton<CaelumPlugin>, public Ogre::Plugin
-    {
-    public:
-        /// Get reference to singleton instance; or crash if N/A.
-        static CaelumPlugin& getSingleton(void);
-        /// Get pointer to singleton instance; or pointer if N/A.
-        static CaelumPlugin* getSingletonPtr(void);
-
-        CaelumPlugin();
-        ~CaelumPlugin();
-
-        virtual void install ();
-        virtual void initialise ();
-        virtual void shutdown ();
-        virtual void uninstall ();
-
-        static const Ogre::String CAELUM_PLUGIN_NAME;
-        virtual const String& getName () const;
-
-        // Determine if the plugin was installed (if install was called).
-        inline bool isInstalled () const { return mIsInstalled; }
-
-   private:
-        bool mIsInstalled;
-
-#if CAELUM_TYPE_DESCRIPTORS
-   public:
-        /// Get default type descriptor data for caelum components.
-        CaelumDefaultTypeDescriptorData* getTypeDescriptorData () { return &mTypeDescriptorData; }
-
-   private:
-        CaelumDefaultTypeDescriptorData mTypeDescriptorData;
-#endif
-
-#if CAELUM_SCRIPT_SUPPORT
-   public:
-        /** Load CaelumSystem and it's components from a script file.
-         *  @param sys Target CaelumSystem.
-         *      This is cleared using CaelumSystem::clear before loading.
-         *      If scripting data is not found then this is not modified.
-         *  @param objectName Name of caelum_sky_system from *.os file.
-         *  @param scriptFileGroup The group to search in (unused in Ogre 1.6)
-         */
-        void loadCaelumSystemFromScript (
-                CaelumSystem* sys,
-                const Ogre::String& objectName,
-                const Ogre::String& scriptFileGroup = Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
-                );
-
-        /// @see PropScriptResourceManager
-        PropScriptResourceManager* getPropScriptResourceManager () { return &mPropScriptResourceManager; }
-        CaelumScriptTranslatorManager* getScriptTranslatorManager () { return &mScriptTranslatorManager; }
-
-   private:
-        PropScriptResourceManager mPropScriptResourceManager;
-        CaelumScriptTranslatorManager mScriptTranslatorManager;
-#endif
-    };
-}
-
-#endif // CAELUM__CAELUM_PLUGIN_H
diff --git a/extern/caelum/include/CaelumPrecompiled.h b/extern/caelum/include/CaelumPrecompiled.h
deleted file mode 100644
index e93bd8404e..0000000000
--- a/extern/caelum/include/CaelumPrecompiled.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef __APPLE__
-#include "Ogre/Ogre.h"
-#else
-#include "Ogre.h"
-#endif
diff --git a/extern/caelum/include/CaelumPrerequisites.h b/extern/caelum/include/CaelumPrerequisites.h
deleted file mode 100644
index 093b3ab5a1..0000000000
--- a/extern/caelum/include/CaelumPrerequisites.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__CAELUM_PREREQUISITES_H
-#define CAELUM__CAELUM_PREREQUISITES_H
-
-// Include external headers
-#ifdef __APPLE__
-#include "Ogre/Ogre.h"
-#else
-#include "Ogre.h"
-#endif
-
-#include <memory>
-
-// Define the dll export qualifier if compiling for Windows
-#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
-	#ifdef CAELUM_STATIC
-        // Don't use dll export qualifier when built as a static lib
-		#define CAELUM_EXPORT
-	#elif CAELUM_LIB
-		#define CAELUM_EXPORT __declspec (dllexport)
-	#else
-		#ifdef __MINGW32__
-			#define CAELUM_EXPORT
-		#else
-			#define CAELUM_EXPORT __declspec (dllimport)
-		#endif
-	#endif
-#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-	#define CAELUM_EXPORT __attribute__ ((visibility("default")))
-#else
-	#define CAELUM_EXPORT
-#endif
-
-// Define the version code
-#define CAELUM_VERSION_MAIN 0
-#define CAELUM_VERSION_SEC 5
-#define CAELUM_VERSION_TER 0
-#define CAELUM_VERSION = (CAELUM_VERSION_MAIN << 16) | (CAELUM_VERSION_SEC << 8) | CAELUM_VERSION_TER
-
-// By default only compile type descriptors for scripting.
-#ifndef CAELUM_TYPE_DESCRIPTORS
-    #if (OGRE_VERSION >= 0x00010600) && OGRE_USE_NEW_COMPILERS
-        #define CAELUM_TYPE_DESCRIPTORS 1
-    #else
-        #define CAELUM_TYPE_DESCRIPTORS 0
-    #endif
-#endif
-
-// Scripting support requires Ogre 1.6
-// Can be also configured on compiler command line
-#ifndef CAELUM_SCRIPT_SUPPORT
-    #if (OGRE_VERSION >= 0x00010600) && OGRE_USE_NEW_COMPILERS
-        #define CAELUM_SCRIPT_SUPPORT 1
-    #else
-        #define CAELUM_SCRIPT_SUPPORT 0
-    #endif
-#else
-    #if !(OGRE_VERSION > 0x00010600)
-        #error "Caelum script support requires Ogre 1.6."
-    #endif
-    #if !(OGRE_USE_NEW_COMPILERS)
-        #error "Caelum script support requires Ogre 1.6 with OGRE_USE_NEW_COMPILERS."
-    #endif
-    #if !(CAELUM_TYPE_DESCRIPTORS)
-        #error "Caelum script support also requires type descriptors."
-    #endif
-#endif
-
-/// @file
-
-/** @mainpage
- *
- *  %Caelum is an Ogre add-on for atmospheric rendering. It is composed of a
- *  number of small mostly self-contained components and a big
- *  Caelum::CaelumSystem class which ties them all together in an easy-to-use
- *  way.
- *
- *  More information is available on the wiki page:
- *  http://www.ogre3d.org/wiki/index.php/Caelum
- *
- *  You can discuss and report issues in the forum:
- *  http://www.ogre3d.org/addonforums/viewforum.php?f=21
- */
-
-/** Caelum namespace
- *
- *  All of %Caelum is inside this namespace (except for macros).
- *
- *  @note: This was caelum with a lowercase 'c' in version 0.3
- */
-namespace Caelum
-{
-    // Caelum needs a lot of precission for astronomical calculations.
-    // Very few calculations use it, and the precission IS required.
-    typedef double LongReal;
-
-    // Use some ogre types.
-    using Ogre::uint8;
-    using Ogre::uint16;
-    using Ogre::ushort;
-    using Ogre::uint32;
-    using Ogre::uint;
-
-    using Ogre::Real;
-    using Ogre::String;
-
-    /// Resource group name for caelum resources.
-    static const String RESOURCE_GROUP_NAME = "Caelum";
-
-    // Render group for caelum stuff
-    // It's best to have them all together
-    enum CaelumRenderQueueGroupId
-    {
-        CAELUM_RENDER_QUEUE_STARFIELD       = Ogre::RENDER_QUEUE_SKIES_EARLY + 0,
-		CAELUM_RENDER_QUEUE_MOON_BACKGROUND = Ogre::RENDER_QUEUE_SKIES_EARLY + 1,
-        CAELUM_RENDER_QUEUE_SKYDOME         = Ogre::RENDER_QUEUE_SKIES_EARLY + 2,
-		CAELUM_RENDER_QUEUE_MOON            = Ogre::RENDER_QUEUE_SKIES_EARLY + 3,
-        CAELUM_RENDER_QUEUE_SUN             = Ogre::RENDER_QUEUE_SKIES_EARLY + 4,
-        CAELUM_RENDER_QUEUE_CLOUDS          = Ogre::RENDER_QUEUE_SKIES_EARLY + 5,
-        CAELUM_RENDER_QUEUE_GROUND_FOG      = Ogre::RENDER_QUEUE_SKIES_EARLY + 6,
-    };
-
-    // Forward declarations
-    class UniversalClock;
-    class SkyDome;
-    class BaseSkyLight;
-    class Moon;
-    class SphereSun;
-    class SpriteSun;
-    class ImageStarfield;
-    class PointStarfield;
-    class CloudSystem;
-    class CaelumSystem;
-	class FlatCloudLayer;
-    class PrecipitationController;
-    class PrecipitationInstance;
-    class GroundFog;
-    class DepthComposer;
-    class DepthComposerInstance;
-    class DepthRenderer;
-}
-
-namespace Ogre 
-{
-#if OGRE_VERSION <= 0x010602
-    // Write an Ogre::Degree to a stream.
-    //
-    // Ogre::Any requires that the wrapped type can be written to a stream;
-    // otherwise it will fail on instantation. This function was placed here
-    // so it's available everywhere. This can't be placed in namespace Caelum.
-    //
-    // Ogre 1.6.3 and up already include this operator; so it's ifdefed out.
-    //
-    // This function is never actually used; the output does not matter.
-    inline std::ostream& operator << (std::ostream& out, Ogre::Degree deg) {
-        return out << deg.valueDegrees();
-    }
-#endif
-}
-
-#endif // CAELUM__CAELUM_PREREQUISITES_H
diff --git a/extern/caelum/include/CaelumScriptTranslator.h b/extern/caelum/include/CaelumScriptTranslator.h
deleted file mode 100644
index d125087262..0000000000
--- a/extern/caelum/include/CaelumScriptTranslator.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__CAELUM_SCRIPT_TRANSLATOR_H
-#define CAELUM__CAELUM_SCRIPT_TRANSLATOR_H
-
-#if CAELUM_SCRIPT_SUPPORT
-
-#include "CaelumPrerequisites.h"
-#include "OgreScriptTranslator.h"
-#include "TypeDescriptor.h"
-
-namespace Caelum
-{
-    /** Dummy resources created for property script blocks.
-     *
-     *  When parsing material scripts the singleton rendersystem is available
-     *  and materials are created using it. But Caelum's scriptable components
-     *  require at least an active scene scene manager; and you can't require
-     *  something like that when initializing resources.
-     *
-     *  So instead a dummy resource like this is created which only remembers
-     *  the location of the script block in the resources. Actually loading the
-     *  properties will always reparse the script.
-     *
-     *  The original file name is available from Ogre::Resource::getOrigin
-     *
-     *  These resources are managed by the PropScriptResourceManager. Resource
-     *  operations like loading and unloading are meaningless.
-     */
-    class CAELUM_EXPORT PropScriptResource: public Ogre::Resource {
-    protected:
-        virtual void loadImpl () { }
-        virtual void unloadImpl () { }
-        virtual size_t calculateSize () const { return 0; }
-
-    public:
-		PropScriptResource (
-                Ogre::ResourceManager* creator, const Ogre::String& name, Ogre::ResourceHandle handle,
-			    const Ogre::String& group, bool isManual, Ogre::ManualResourceLoader* loader);
-		~PropScriptResource();
-    };
-
-    /** Resource manager for PropScriptResource.
-     */
-    class CAELUM_EXPORT PropScriptResourceManager: public Ogre::ResourceManager
-    {
-    public:
-        PropScriptResourceManager();
-
-		virtual PropScriptResource* createImpl(
-                const String& name, Ogre::ResourceHandle handle, const String& group,
-                bool isManual, Ogre::ManualResourceLoader* loader, const Ogre::NameValuePairList* createParams);
-    };
-
-    /** An Ogre::ScriptTranslator based on a TypeDescriptor.
-     *  This class implements an Ogre::ScriptTranslator based on data from a TypeDescriptor.
-     *
-     *  The target object is never created; it must be passed in the context member of the
-     *  root node. Some other ScriptTranslator must cooperate and set the context member;
-     *  this is similar to how Ogre::PassTranslator depends on Ogre::MaterialTranslator
-     *  setting the context.
-     *
-     *  Ogre::AbstractNode::context is an Ogre::Any which boxes objects in a way which
-     *  stores the static (compile-time) type at assignment. You must cast the
-     *  object into a void* before setting it as the context.
-     *
-     *  Most of the actual translation functionality is in static functions; a class can
-     *  translate based on TypeDescriptor data without deriving from this class.
-     */
-    class CAELUM_EXPORT TypeDescriptorScriptTranslator: public Ogre::ScriptTranslator
-    {
-    public:
-        /** Get the value of a property or report the appropriate error.
-         *  @return Success value.
-         */
-        static bool getPropValueOrAddError (Ogre::ScriptCompiler* compiler, Ogre::PropertyAbstractNode* prop, int& value);
-        static bool getPropValueOrAddError (Ogre::ScriptCompiler* compiler, Ogre::PropertyAbstractNode* prop, float& value);
-        static bool getPropValueOrAddError (Ogre::ScriptCompiler* compiler, Ogre::PropertyAbstractNode* prop, double& value);
-        static bool getPropValueOrAddError (Ogre::ScriptCompiler* compiler, Ogre::PropertyAbstractNode* prop, bool& value);
-        static bool getPropValueOrAddError (Ogre::ScriptCompiler* compiler, Ogre::PropertyAbstractNode* prop, Ogre::Degree& value);
-        static bool getPropValueOrAddError (Ogre::ScriptCompiler* compiler, Ogre::PropertyAbstractNode* prop, Ogre::ColourValue& value);
-        static bool getPropValueOrAddError (Ogre::ScriptCompiler* compiler, Ogre::PropertyAbstractNode* prop, Ogre::String& value);
-        static bool getPropValueOrAddError (Ogre::ScriptCompiler* compiler, Ogre::PropertyAbstractNode* prop, Ogre::Vector3& value);
-        static bool getPropValueOrAddError (Ogre::ScriptCompiler* compiler, Ogre::PropertyAbstractNode* prop, Ogre::Vector2& value);
-
-        /** Translate a property using a TypeDescriptor; or report error to compiler.
-         */
-        static void translateProperty (
-                Ogre::ScriptCompiler* compiler,
-                Ogre::PropertyAbstractNode* prop,
-                void* targetObject,
-                const TypeDescriptor* typeDescriptor);
-
-    public:
-        explicit TypeDescriptorScriptTranslator (TypeDescriptor* type = 0);
-
-        virtual void translate (Ogre::ScriptCompiler* compiler, const Ogre::AbstractNodePtr& node);
-
-        inline const TypeDescriptor* getTypeDescriptor () const { return mTypeDescriptor; }
-        inline TypeDescriptor* getTypeDescriptor () { return mTypeDescriptor; }
-
-    private:
-        TypeDescriptor* mTypeDescriptor;
-    };
-
-    /** Script translator for CaelumSystem
-     */
-    struct CAELUM_EXPORT CaelumSystemScriptTranslator: public Ogre::ScriptTranslator
-    {
-    public:
-        CaelumSystemScriptTranslator();
-
-        virtual void translate (Ogre::ScriptCompiler* compiler, const Ogre::AbstractNodePtr& node);
-
-        void setTranslationTarget (CaelumSystem* target, const Ogre::String& name);
-        void clearTranslationTarget ();
-
-        inline bool hasTranslationTarget () const { return mTranslationTarget != 0; }
-        inline bool foundTranslationTarget () const { return mTranslationTargetFound; }
-        inline CaelumSystem* getTranslationTarget () const { return mTranslationTarget; }
-        inline const Ogre::String& getTranslationTargetName () const { return mTranslationTargetName; }
-
-        inline void setResourceManager (PropScriptResourceManager* value) { mResourceManager = value; }
-        inline PropScriptResourceManager* getResourceManager () const { return mResourceManager; }
-
-    private:
-        PropScriptResourceManager* mResourceManager;
-        CaelumSystem* mTranslationTarget;
-        Ogre::String mTranslationTargetName;
-        bool mTranslationTargetFound;
-
-    public:
-        /** Type descriptor for CaelumSystem itself.
-         *  This is use for simple top-level properties.
-         *  Components (sun, moon etc) are handled with custom code.
-         */
-        inline const TypeDescriptor* getTypeDescriptor () const { return mTypeDescriptor; }
-        inline void setTypeDescriptor (const TypeDescriptor* value) { mTypeDescriptor = value; }
-
-    private:
-        const TypeDescriptor* mTypeDescriptor;
-    };
-
-    /** Script translator for CloudSystem
-     *  Caelum::CloudSystem requires a special translator because it's made up of separate layers.
-     *
-     *  Layers of different types are not supported; only instances of FlatCloudLayer.
-     *  CloudSystem doesn't have any top-level properties.
-     *
-     *  Overriding works just like for ogre texture units; and you can use name-based overriding.
-     *  Names are not preserved after script translation; they're only used inside Ogre's script
-     *  compilation steps.
-     */
-    struct CAELUM_EXPORT CloudSystemScriptTranslator: public Ogre::ScriptTranslator
-    {
-    public:
-        virtual void translate (Ogre::ScriptCompiler* compiler, const Ogre::AbstractNodePtr& node);
-    };
-
-    /** ScriptTranslatorManager for caelum's scriptable objects.
-     *  This class contains Ogre::ScriptTranslators for Caelum components.
-     */ 
-    class CAELUM_EXPORT CaelumScriptTranslatorManager: public Ogre::ScriptTranslatorManager
-    {
-    public:
-        explicit CaelumScriptTranslatorManager (CaelumDefaultTypeDescriptorData* typeData);
-
-        virtual size_t getNumTranslators () const;
-
-        /// @copydoc Ogre::ScriptTranslatorManager::getTranslator.
-        virtual Ogre::ScriptTranslator* getTranslator (const Ogre::AbstractNodePtr& node);
-
-        void _setPropScriptResourceManager (PropScriptResourceManager* mgr);
-
-        inline CaelumSystemScriptTranslator* getCaelumSystemTranslator () { return &mCaelumSystemTranslator; }
-
-    private:
-        CaelumSystemScriptTranslator mCaelumSystemTranslator;
-        CloudSystemScriptTranslator mCloudSystemTranslator;
-        TypeDescriptorScriptTranslator mFlatCloudLayerTranslator;
-        TypeDescriptorScriptTranslator mSunTranslator;
-        TypeDescriptorScriptTranslator mMoonTranslator;
-        TypeDescriptorScriptTranslator mPointStarfieldTranslator;
-        TypeDescriptorScriptTranslator mGroundFogTranslator;
-        TypeDescriptorScriptTranslator mDepthComposerTranslator;
-        TypeDescriptorScriptTranslator mPrecipitationTranslator;
-        TypeDescriptorScriptTranslator mSkyDomeTranslator;
-
-        /// Maps class name to script translator.
-        /// Does not own memory; just holds pointers to members.
-        typedef std::map<Ogre::String, Ogre::ScriptTranslator*> ScriptTranslatorMap;
-        ScriptTranslatorMap mTranslatorMap;
-    };
-}
-
-#endif // CAELUM_SCRIPT_SUPPORT
-
-#endif // CAELUM__CAELUM_SCRIPT_TRANSLATOR_H
diff --git a/extern/caelum/include/CaelumSystem.h b/extern/caelum/include/CaelumSystem.h
deleted file mode 100644
index 3c670d03a8..0000000000
--- a/extern/caelum/include/CaelumSystem.h
+++ /dev/null
@@ -1,672 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__CAELUM_SYSTEM_H
-#define CAELUM__CAELUM_SYSTEM_H
-
-#include "CaelumPrerequisites.h"
-#include "UniversalClock.h"
-#include "ImageStarfield.h"
-#include "PointStarfield.h"
-#include "SkyLight.h"
-#include "Sun.h"
-#include "Moon.h"
-#include "CloudSystem.h"
-#include "SkyDome.h"
-#include "DepthComposer.h"
-#include "PrecipitationController.h"
-#include "GroundFog.h"
-#include "PrivatePtr.h"
-
-namespace Caelum
-{
-    /** This is the "root class" of caelum.
-     *
-     *  This class is created once for one SceneManager and will render the sky
-     *  for that scene. CaelumSystem will be visible in all viewports on the
-     *  scene and must be notified when those viewports are created and
-     *  destroyed.
-     *  
-     *  @par Components
-     *
-     *  %Caelum is built from several classes for different sky elements (the sun,
-     *  clouds, etc). Those classes know very little about each other and are 
-     *  connected through this class. This class is responsible for tracking and
-     *  updating sub-components.
-     *
-     *  This class "owns" all of the subcomponents, using std::auto_ptr members.
-     *  When you call functions like setXxx(new Xxx()) this class takes
-     *  ownership of the object's lifetime and will try to update it as
-     *  appropriate. All components are optional; disable one component should
-     *  never cause a crash. When something is broken disabling components one
-     *  by one is a very good way to find the source of the problem.
-     *
-     *  The constructor can create a bunch of components with default settings
-     *  for you; based on the CaelumSystem::CaelumComponent flags passed.
-     *
-     *  @par Updating
-     *
-     *  This class is responsible for updating subcomponents. There are two
-     *  update functions which must be get called to keep CaelumSystem
-     *  functioning properly. One is per-frame and the other is per-camera.
-     *
-     *  CaelumSystem::updateSubcomponents must be called once per frame to
-     *  advance world time and tie components together. That function will
-     *  set certain properties on the subcomponents making up CaelumSystem
-     *  If you want to force some properties beyond what CaelumSystem does by
-     *  default you can do that AFTER the call to updateSubcompoments. For
-     *  example you can override the moon's phase by calling Moon::setPhase.
-     *
-     *  CaelumSystem::notifyCameraChanged must be called for each camera
-     *  before rendering with that camera. All viewport tweaks and camera
-     *  movement must be done BEFORE calling this function. This method will
-     *  recenter Caelum's domes on the camera. Also, some subcomponents
-     *  can actually depend on field-of-view and viewport resolution (like
-     *  PointStarfield).
-     *
-     *  You can register CaelumSystem as an Ogre::FrameListener and
-     *  updateSubcomponents will be automatically called inside Ogre's
-     *  rendering loop (inside frameStarted). If you want more control you
-     *  should call updateSubcomponents in your own main loop. That way you
-     *  can avoid potential issues with the ordering of multiple FrameListeners.
-     *
-     *  You can register CaelumSystem as an Ogre::RenderTargetListener and
-     *  notifyCameraChanged will be automatically called inside
-     *  preViewportUpdate. That behaviour can be disabled with
-     *  setAutoNotifyCameraChanged(false). It is recommended that you 
-     *  call notifyCameraChanged manually before updating viewports.
-     *
-     *  RenderTargetListener::preViewportUpdate does not work as expected
-     *  when compositors are involved (those inside Caelum or external).
-     *  Compositors plug into preRenderTargetUpdate and render the scene to a
-     *  texture BEFORE preViewportUpdate; this means that notifyCameraChanged
-     *  will execute before the final compositor pass but after actual scene
-     *  rendering.
-     *
-     *  If notifyCameraChanged is not called correctly the most likely result
-     *  is "flickering" when moving the camera. If you move the camera AFTER
-     *  notifyCameraChanged then the domes will not be positioned correctly
-     *  and will appear to lag slightly after the camera. Since updates are
-     *  always done every frame keeping the camera still will make problems
-     *  disappear.
-     *
-     *  If you notice z-buffer issues while the camera is still update order
-     *  is probably not the cause.
-     */
-    class CAELUM_EXPORT CaelumSystem:
-            public Ogre::FrameListener,
-            public Ogre::RenderTargetListener
-    {
-	private:
-		/// Root of the Ogre engine.
-		Ogre::Root *mOgreRoot;
-
-		/// Scene manager.
-		Ogre::SceneManager *mSceneMgr;
-
-        /// Caelum scene node for camera-bound elements (most).
-		PrivateSceneNodePtr mCaelumCameraNode;
-
-        /// Caelum scene node for ground-bound elements (only clouds currently).
-		PrivateSceneNodePtr mCaelumGroundNode;
-
-		/// Cleanup requested flag.
-		bool mCleanup;
-
-        /// Automatically move the camera node.
-        bool mAutoMoveCameraNode;
-
-        /// Automatically call this->notifyCameraChanged.
-        bool mAutoNotifyCameraChanged;
-
-        /// Automatically attach compositors to viewports
-        bool mAutoAttachViewportsToComponents;
-
-        /// Automatically set the viewport colour to black.
-        bool mAutoViewportBackground;
-
-        /// Flag to indicate if Caelum manages standard Ogre::Scene fog.
-		bool mManageSceneFog;
-
-        Real mGlobalFogDensityMultiplier;
-        Ogre::ColourValue mGlobalFogColourMultiplier;
-
-        Real mSceneFogDensityMultiplier;
-        Ogre::ColourValue mSceneFogColourMultiplier;
-
-        Real mGroundFogDensityMultiplier;
-        Ogre::ColourValue mGroundFogColourMultiplier;
-
-        /// Flag for managing scene ambient light.
-		bool mManageAmbientLight;
-
-        /// Minimum ambient light; only useful if mManageAmbientLight
-        Ogre::ColourValue mMinimumAmbientLight;
-
-        /// If only one light source should enabled at a time.
-        bool mEnsureSingleLightSource;
-
-        /// Ensure only one of the light sources casts shadows.
-        bool mEnsureSingleShadowSource;
-
-		/// The sky gradients image (for lookups).
-        std::auto_ptr<Ogre::Image> mSkyGradientsImage;
-
-        /// The sun gradients image (for lookups).
-        std::auto_ptr<Ogre::Image> mSunColoursImage;
-
-        /// Observer Latitude (on the earth).
-        Ogre::Degree mObserverLatitude;
-        /// Observer Longitude (on the earth).
-        Ogre::Degree mObserverLongitude;
-
-        static const Ogre::Vector3 makeDirection (
-                Ogre::Degree azimuth, Ogre::Degree altitude);
-		
-		// References to sub-components
-        std::auto_ptr<UniversalClock> mUniversalClock;
-        std::auto_ptr<SkyDome> mSkyDome;
-        std::auto_ptr<BaseSkyLight> mSun;
-        std::auto_ptr<Moon> mMoon;
-        std::auto_ptr<ImageStarfield> mImageStarfield;
-        std::auto_ptr<PointStarfield> mPointStarfield;
-        std::auto_ptr<GroundFog> mGroundFog;
-        std::auto_ptr<CloudSystem> mCloudSystem;
-		std::auto_ptr<PrecipitationController> mPrecipitationController;
-		std::auto_ptr<DepthComposer> mDepthComposer;
-
-    public:
-        typedef std::set<Ogre::Viewport*> AttachedViewportSet;
-
-    private:
-        AttachedViewportSet mAttachedViewports;
-
-	public:
-        /** Flags enumeration for caelum components.
-         *  This is an enumeration for the components to create by default in
-         *  Caelum's constructor. You can still pass 0 and create everything
-         *  by hand.
-         * 
-         *  CaelumSystem's constructor used to take a number of bools but now
-         *  there are too many components and this is nicer.
-         * 
-         *  CAELUM_COMPONENT_ members are for individual components.
-         *  CAELUM_COMPONENTS_ are standard bitmasks.
-         *  CAELUM_COMPONENTS_DEFAULT picks elements that don't require
-         *  modifications to external materials (right now it excludes ground fog).
-         */
-        enum CaelumComponent
-        {
-            CAELUM_COMPONENT_SKY_DOME           = 1 << 1,
-            CAELUM_COMPONENT_MOON				= 1 << 3,
-            CAELUM_COMPONENT_SUN                = 1 << 4,
-            CAELUM_COMPONENT_IMAGE_STARFIELD    = 1 << 5,
-            CAELUM_COMPONENT_POINT_STARFIELD    = 1 << 6,
-            CAELUM_COMPONENT_CLOUDS             = 1 << 7,
-            CAELUM_COMPONENT_PRECIPITATION      = 1 << 8,
-            CAELUM_COMPONENT_SCREEN_SPACE_FOG   = 1 << 9,
-
-            // This has nasty dependencies on materials.
-            CAELUM_COMPONENT_GROUND_FOG         = 1 << (16 + 0),
-
-            // Groups
-            CAELUM_COMPONENTS_NONE              = 0,
-            CAELUM_COMPONENTS_DEFAULT           = 0
-                    | CAELUM_COMPONENT_SKY_DOME
-                    | CAELUM_COMPONENT_MOON
-                    | CAELUM_COMPONENT_SUN
-                    | CAELUM_COMPONENT_POINT_STARFIELD
-                    | CAELUM_COMPONENT_CLOUDS,
-            CAELUM_COMPONENTS_ALL               = 0
-                    | CAELUM_COMPONENTS_DEFAULT
-                    | CAELUM_COMPONENT_PRECIPITATION 
-                    | CAELUM_COMPONENT_SCREEN_SPACE_FOG
-                    | CAELUM_COMPONENT_GROUND_FOG,
-        };
-
-        static const String DEFAULT_SKY_GRADIENTS_IMAGE;
-        static const String DEFAULT_SUN_COLOURS_IMAGE;
-    
-		/** Constructor.
-		 *  Registers itself in the Ogre engine and initialises the system.
-         *
-         *  @param root The Ogre root.
-		 *  @param scene The Ogre scene manager.
-		 *  @param componentsToCreate Default components for @see autoConfigure.
-		 */
-		CaelumSystem (
-                Ogre::Root *root, 
-				Ogre::SceneManager *sceneMgr,
-                CaelumComponent componentsToCreate);
-
-        /** Revert everything to defaults.
-         *
-         *  This function will delete all subcomponents and revert everything
-         *  to default values (the values which are also set on construction).
-         */
-        void clear ();
-
-        /** Create some default component with resonable default settings.
-         *  This results in a slightly cloudy morning sky.
-         *  This will always call clear() before creating components.
-         *  autoConfigure (0); is equivalent to clear();
-         */
-        void autoConfigure (
-                CaelumComponent componentsToCreate);
-
-		/** Destructor.
-		 */
-		~CaelumSystem ();
-
-		/** Shuts down the system and detaches itself from the Ogre engine.
-         *
-         *  shutdown(true) is equivalent to deleting CaelumSystem yourself.
-         *  shutdown(false) delays destruction to the next time caelum is called as
-         *  a frame listener. This makes it safe to shutdown Caelum from inside
-         *  another frame listener.
-         *
-         *  @param cleanup If this is true then detach and destroy the CaelumSystem instantly.
-		 */
-		void shutdown (bool cleanup);
-
-        /** Update the whole system manually.
-         *  You have to call this yourself if you don't register CaelumSystem
-         *  as an ogre frame listener. Otherwise it's called automatically.
-         *
-         *  @param timeSinceLastFrame: Time passed since last frame.
-         */
-        void updateSubcomponents (Real timeSinceLastFrame);
-
-        /** Notify subcomponents of camera changes.
-         *  This function must be called after camera changes but before
-         *  rendering with that camera. If multiple cameras are used it must
-         *  be called for each camera before the camera is rendered with.
-         *
-         *  This function will move caelum's camera node to the camera
-         *  position, but only if getAutoMoveCameraNode.
-         *  It will also call CameraBoundElement::notifyCameraChanged
-         */
-        void notifyCameraChanged(Ogre::Camera* cam);
-
-        /** Get the scene manager for this caelum system.
-         *  This is set in the constructor. CaelumSystem can't exist without a valid scene manager.
-         */
-        inline Ogre::SceneManager* getSceneMgr() const { return mSceneMgr; }
-
-		/// Gets root scene node for camera-bound elements
-        inline Ogre::SceneNode* getCaelumCameraNode(void) const { return mCaelumCameraNode.get(); }
-
-		/// Gets root scene node for ground-bound elements.
-        inline Ogre::SceneNode* getCaelumGroundNode(void) const { return mCaelumGroundNode.get(); }
-
-        /** If true; listen to preViewportUpdate and automatically notifyCameraChanged();
-         *
-         *  This is on by default; but does not work with compositors.
-         *
-         *  You must attach CaelumSystem as a RenderTargetListener manually for
-         *  this to work; as in version 0.3.
-         */
-        inline void setAutoNotifyCameraChanged(bool value) { mAutoNotifyCameraChanged = value; }
-        /// @see setAutoNotifyCameraChanged
-        inline bool getAutoNotifyCameraChanged() const { return mAutoNotifyCameraChanged; }
-
-        /** If true; automatically attach viewports to subcomponents.
-         *
-         *  Some subcomponents use compositors and those compositors need to
-         *  be attached to individual viewports. By default CaelumSystem will
-         *  try take to take care of that automatically.
-         *
-         *  This property allows you to disable that behaviour. If set to false
-         *  you must call functions like
-         *  PrecipitationController::createViewportInstance manually.
-         *
-         *  @see attachViewport detachViewport
-         */
-        inline void setAutoAttachViewportsToComponents(bool value) { mAutoAttachViewportsToComponents = value; }
-        /// @see setAutoAttachViewportsToComponents.
-        inline bool getAutoAttachViewportsToComponents() const { return mAutoAttachViewportsToComponents; }
-
-        /** If true (default); automatically move the camera node in notifyCameraChanged.
-         *  If disable you get full control of the camera node; and in theory
-         *  you can attach it to the scene graph however you please.
-         */
-        inline void setAutoMoveCameraNode(bool value) { mAutoMoveCameraNode = value; }
-        /// @see setAutoMoveCameraNode
-        inline bool getAutoMoveCameraNode() { return mAutoMoveCameraNode; }
-
-        /** If true; automatically set the viewport color to black.
-         *  Caelum's domes relies on the viewport background being black.
-         *  There's generally no reason to disable this and it's on by default.
-         */
-        inline void setAutoViewportBackground(bool value) { mAutoViewportBackground = value; }
-        /// @see setAutoViewportBackground
-        inline bool getAutoViewportBackground() const { return mAutoViewportBackground; }
-
-        /// Get the observer's longitude. East is positive, west is negative.
-        inline const Ogre::Degree getObserverLongitude () const { return mObserverLongitude; }
-
-        /// Set the observer's longitude. East is positive, west is negative.
-        inline void setObserverLongitude (Ogre::Degree value) { mObserverLongitude = value; }
-
-        /// Get the observer's latitude. North is positive, south is negative.
-        inline const Ogre::Degree getObserverLatitude () const { return mObserverLatitude; }
-
-        /// Set the observer's latitude. North is positive, south is negative.
-        inline void setObserverLatitude (Ogre::Degree value) { mObserverLatitude = value; }
-
-        inline LongReal getJulianDay () const { return mUniversalClock->getJulianDay (); }
-        inline void setJulianDay (LongReal value) { mUniversalClock->setJulianDay (value); }
-        inline Real getTimeScale () const { return mUniversalClock->getTimeScale (); }
-        inline void setTimeScale (Real value) { mUniversalClock->setTimeScale (value); }
-
-    public:
-        /** Attach CaelumSystem to a viewport.
-         *  You should call this for every new viewport looking at the scene
-         *  where CaelumSystem is created.
-         *
-         *  If the viewport is already attached then nothing happens.
-         *
-         *  If getAutoAttachViewportsToComponents() this will add Caelum's compositors.
-         */
-		void attachViewport (Ogre::Viewport* rt);
-
-        /** Reverse of @see attachViewport.
-         *  You need to call this when you destroy a viewport.
-         *
-         *  If the viewport is not already attached nothing happens.
-         */
-		void detachViewport (Ogre::Viewport* rt);
-
-        /** Check if one particular viewport is attached.
-         */
-        bool isViewportAttached (Ogre::Viewport* vp) const;
-
-        /** Detach from all viewports.
-         */
-        void detachAllViewports ();
-
-        /// Get a reference to the set of attached viewports.
-        const AttachedViewportSet& _getAttachedViewportSet () { return mAttachedViewports; }
-
-    protected:
-        // Do the work behind attach/detach viewport.
-		void attachViewportImpl (Ogre::Viewport* rt);
-		void detachViewportImpl (Ogre::Viewport* rt);
-        
-    public:
-		/// Gets the universal clock.
-        inline UniversalClock *getUniversalClock () const { return mUniversalClock.get(); }
-
-		/// Get the current sky dome, or null if disabled.
-        inline SkyDome* getSkyDome () const { return mSkyDome.get (); }
-		/// Set the skydome, or null to disable.
-        void setSkyDome (SkyDome *obj);
-
-		/// Gets the current sun, or null if disabled.
-        inline BaseSkyLight* getSun () const { return mSun.get (); }
-		/// Set the sun, or null to disable.
-		void setSun (BaseSkyLight* obj);
-
-		/// Gets the current moon, or null if disabled.
-        inline Moon* getMoon () const { return mMoon.get (); }
-		/// Set the moon, or null to disable.
-		void setMoon (Moon* obj);
-
-		/// Gets the current image starfield, or null if disabled.
-        inline ImageStarfield* getImageStarfield () const { return mImageStarfield.get (); }
-		/// Set image starfield, or null to disable.
-        void setImageStarfield (ImageStarfield* obj);
-
-		/// Gets the current point starfield, or null if disabled.
-        inline PointStarfield* getPointStarfield () const { return mPointStarfield.get (); }
-		/// Set image starfield, or null to disable.
-        void setPointStarfield (PointStarfield* obj);
-
-		/// Get ground fog; if enabled.
-        inline GroundFog* getGroundFog () { return mGroundFog.get (); }
-		/// Sets ground fog system, or null to disable.
-        void setGroundFog (GroundFog *obj);
-
-        /// Get cloud system; or null if disabled.
-        inline CloudSystem* getCloudSystem () { return mCloudSystem.get (); }
-        /// Set cloud system; or null to disable.
-        void setCloudSystem (CloudSystem *obj);
-
-        /// Get precipitation controller; or null if disabled.
-		inline PrecipitationController* getPrecipitationController () { return mPrecipitationController.get (); }
-        /// Set precipitation controller; or null to disable.
-		void setPrecipitationController (PrecipitationController *obj);
- 
-        /// Get depth composer; or null if disabled.
-		inline DepthComposer* getDepthComposer () { return mDepthComposer.get (); }
-        /// Set depth composer; or null to disable.
-		void setDepthComposer (DepthComposer *obj);
- 
-		/** Enables/disables Caelum managing standard Ogre::Scene fog.
-            This makes CaelumSystem control standard Ogre::Scene fogging. It
-            will use EXP2 fog with density from SkyColourModel.
-
-            Fog density multipliers are used; final scene fog density is:
-            SceneMultiplier * GlobalMultiplier * SkyColourModel.GetFogDensity
-
-            When this is set to false it also disables all scene fog (but you
-            control it afterwards).
-
-            @param value New value
-		 */
-		void setManageSceneFog (bool value);
-
-		/** Tells if Caelum is managing the fog or not.
-			@return The value set in setManageSceneFog.
-		 */
-		bool getManageSceneFog () const;
-
-        /** Multiplier for scene fog density (default 1).
-            This is an additional multiplier for Ogre::Scene fog density.
-            This has no effect if getManageSceneFog is false.
-
-            Final scene fog density is:
-            SceneMultiplier * GlobalMultiplier * SkyColourModel.GetFogDensity
-         */
-        void setSceneFogDensityMultiplier (Real value);
-
-        /** Get the value set by setSceneFogDensityMultiplier.
-         */
-        Real getSceneFogDensityMultiplier () const;
-
-        /** Set an additional multiplier for fog colour as it comes from SkyColourModel.
-         *  This is 0.7 by default; to be compatible with previous versions.
-         */
-        inline void setSceneFogColourMultiplier (const Ogre::ColourValue& value) { mSceneFogColourMultiplier = value; }
-
-        /// See setSceneFogColourMultiplier.
-        inline const Ogre::ColourValue getSceneFogColourMultiplier () const { return mSceneFogColourMultiplier; }
-
-        /** Multiplier for ground fog density (default 1).
-         *  This is an additional multiplier for Caelum::GroundFog DepthComposer ground fog density.
-         *
-         *  Final ground fog density is:
-         *  GroundFogMultipler * GlobalMultiplier * SkyColourModel.GetFogDensity
-         */
-        void setGroundFogDensityMultiplier (Real value);
-
-        /** Get the value set by setGroundFogDensityMultiplier.
-         */
-        Real getGroundFogDensityMultiplier () const;
-
-        /** Set an additional multiplier for ground fog colour as it comes from SkyColourModel.
-         *  This is OgreColour::White by default; which has no effect.
-         */
-        inline void setGroundFogColourMultiplier (const Ogre::ColourValue& value) { mGroundFogColourMultiplier = value; }
-
-        /// See setGroundFogColourMultiplier.
-        inline const Ogre::ColourValue getGroundFogColourMultiplier () const { return mGroundFogColourMultiplier; }
-
-        /** Multiplier for global fog density (default 1).
-         *  This is an additional multiplier for fog density as received from
-         *  SkyColourModel. There are other multipliers you can tweak for
-         *  individual kinds of fog; but this is what you should change from
-         *  whatever "game logic" you might have.
-         */
-        void setGlobalFogDensityMultiplier (Real value);
-
-        /** Get the value set by setSceneFogDensityMultiplier.
-         */
-        Real getGlobalFogDensityMultiplier () const;
-
-        /** Set an additional multiplier for fog colour.
-         *  This will also affect stuff like clouds or precipitation. Careful!
-         *  This is OgreColour::White by default; which has no effect.
-         */
-        inline void setGlobalFogColourMultiplier (const Ogre::ColourValue& value) { mGlobalFogColourMultiplier = value; }
-
-        /// See setGlobalFogColourMultiplier.
-        inline const Ogre::ColourValue getGlobalFogColourMultiplier () const { return mGlobalFogColourMultiplier; }
-
-        /** Set this to true to have CaelumSystem manage the scene's ambient light.
-         *  The colour and AmbientMultiplier of the sun and moon are used.
-         *  This is false by default.
-         */
-        inline void setManageAmbientLight (bool value) { mManageAmbientLight = value; }
-
-        /// Check if CaelumSystem is managing ambient lighting.
-        inline bool getManageAmbientLight () const { return mManageAmbientLight; }
-
-        /** Set the minimum value for scene ambient lighting,
-         *  This is only used if getManageAmbientLight() is true.
-         *  By default this value is Ogre::ColourValue::Black, so it has no effect.
-         */
-        inline void setMinimumAmbientLight (const Ogre::ColourValue &value) { mMinimumAmbientLight = value; }
-
-        /// @see setMinimumAmbientLight
-        inline const Ogre::ColourValue getMinimumAmbientLight () const { return mMinimumAmbientLight; }
-
-        /** Ensure only one of caelum's light sources is active at a time (the brightest).
-         *  This uses SkyLight::setForceDisable to disable low-intensity lightsources.
-         *  Their contribution to ambient lighting is not affected.
-         *  This implies a single shadow caster.
-         *  This is disabled by default; and you can tweak light disabling by yourself.
-         */
-        inline void setEnsureSingleLightSource (bool value) { mEnsureSingleLightSource = value; }
-
-        /// See setEnsureSingleLightSource
-        inline bool getEnsureSingleLightSource () const { return mEnsureSingleLightSource; }
-
-        /** Ensure only one of caelum's light sources casts shadows (the brightest).
-         *  Disabled by default.
-         */
-        inline void setEnsureSingleShadowSource (bool value) { mEnsureSingleShadowSource = value; }
-
-        /// See setEnsureSingleShadowSource
-        inline bool getEnsureSingleShadowSource () const { return mEnsureSingleShadowSource; }
-
-		/** Gets the fog colour for a certain daytime.
-			@param time The current time.
-			@param sunDir The sun direction.
-			@return The fog colour.
-		 */
-		Ogre::ColourValue getFogColour (Real time, const Ogre::Vector3 &sunDir);
-
-		/** Gets the fog density for a certain daytime.
-			@param time The current time.
-			@param sunDir The sun direction.
-			@return The fog density.
-		 */
-		Real getFogDensity (Real time, const Ogre::Vector3 &sunDir);
-
-		/** Get the colour of the sun sphere.
-         *  This colour is used to draw the sun sphere in the sky.
-		 *  @return The colour of the sun.
-		 */
-		Ogre::ColourValue getSunSphereColour (Real time, const Ogre::Vector3 &sunDir);
-
-		/** Gets the colour of sun light.
-         *  This color is used to illuminate the scene.
-         *  @return The colour of the sun's light
-		 */
-		Ogre::ColourValue getSunLightColour (Real time, const Ogre::Vector3 &sunDir);
-
-		/// Gets the colour of moon's body.
-		Ogre::ColourValue getMoonBodyColour (const Ogre::Vector3 &moonDir);
-
-		/// Gets the colour of moon's light.
-		Ogre::ColourValue getMoonLightColour (const Ogre::Vector3 &moonDir);
-
-		/// Set the sun gradients image.
-		void setSkyGradientsImage (const Ogre::String &filename = DEFAULT_SKY_GRADIENTS_IMAGE);
-
-		/// Set the sun colours image.
-		/// Sun colour is taken from this image.
-		void setSunColoursImage (const Ogre::String &filename = DEFAULT_SUN_COLOURS_IMAGE);
-
-		/** Get the sun's direction at a certain time.
-         *  @param jday astronomical julian day.
-         *  @see UniversalClock for julian day calculations.
-		 */
-		const Ogre::Vector3 getSunDirection (LongReal jday);
-
-		/** Get the moon's direction at a certain time.
-         *  @param jday astronomical julian day.
-		 */
-		const Ogre::Vector3 getMoonDirection (LongReal jday);
-
-        /** Fake function to get the phase of the moon
-         *  @param jday Julian day
-         *  @return the phase of the moon; ranging from 0(full moon) to 2(new moon).
-         *  The calculations performed by this function are completely fake.
-         *  It's a triangle wave with a period of 28.5 days.
-         */
-		const Ogre::Real getMoonPhase (LongReal jday);
-
-    private:
-		/** Handle FrameListener::frameStarted to call updateSubcomponents every frame.
-         *  If you don't register CaelumSystem as a an ogre frame listener you have to
-         *  call updateSubcomponents yourself.
-		 */
-		virtual bool frameStarted (const Ogre::FrameEvent &e);
-
-		/** Event trigger called just before rendering a viewport in a render target Caelum is attached to.
-			Useful to make objects follow every camera that renders a viewport in a certain render target.
-		 */
-		virtual void preViewportUpdate (const Ogre::RenderTargetViewportEvent &e);
-
-        /** Free all subcomponents, but not CaelumSystem itself. Can be called multiple times.
-         *  @param everything To destroy things that can't be rebuilt.
-         */
-        void destroySubcomponents (bool everything);
-
-    public:
-        /** Call setQueryFlags for all subcomponents now.
-         *
-         *  This is not persistent; you can adjust the query masks of
-         *  individual objects afterwards. This also means you should call
-         *  this only after you created all other objects.
-         *
-         *  Has no effect on compositor-based stuff (precipitation will still show up).
-         */
-        void forceSubcomponentQueryFlags (uint mask);
-
-        /** Same as @see forceSubcomponentQueryMask; but for visibility
-         */
-        void forceSubcomponentVisibilityFlags (uint mask);
-    };
-}
-
-#endif // CAELUM__CAELUM_SYSTEM_H
diff --git a/extern/caelum/include/CameraBoundElement.h b/extern/caelum/include/CameraBoundElement.h
deleted file mode 100644
index baef58f2f3..0000000000
--- a/extern/caelum/include/CameraBoundElement.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__CAMERA_BOUND_ELEMENT_H
-#define CAELUM__CAMERA_BOUND_ELEMENT_H
-
-#include "CaelumPrerequisites.h"
-
-namespace Caelum
-{
-    /** A camera-bound element.
-     *
-     *	This should be used as a base class for domes which follow the camera.
-     *  It is only meant to be used inside Caelum.
-     *
-     *  By default this class work in autoradius mode; where it automatically
-     *  resizes itself for camera near/far clipping radius. It will correctly
-     *  handle infinite far clip planes.
-     *
-     *  This is meant to be used with depth_check and depth_write off.
-     *  Trying to place an object "as far as possible" causes precision
-     *  troubles; and was removed in version 0.4.
-     *
-     *  If far clip distance is finite the radius will be (near + far) / 2.
-     *  If far clip distance is infinite (0) the radius will be 10 * near/
-     */
-    class CAELUM_EXPORT CameraBoundElement
-    {
-	private:
-		/// Defines if the element has an automatic "far" radius or not.
-		bool mAutoRadius;
-		
-	public:
-        /** Constructor. Sets auto radius to true.
-         */
-        CameraBoundElement();
-
-		/// Virtual Destructor.
-		virtual ~CameraBoundElement ();
-
-		/** Notify new camera conditions.
-		 *  This method notifies that a new camera is about to be used, so
-         *  this element can follow it or perform other operations.
-         *  The default implementation calls setRadius if in autoRadius mode.
-		 *  @param cam The new camera.
-		 */
-		virtual void notifyCameraChanged (Ogre::Camera *cam) = 0;
-
-		/** Forces the "far" size of the element to a specific radius.
-         *
-         *  If greater than zero this disables AutoRadius mode and forces a
-         *  fixed radius. If this is negative or zero the radius is set
-         *  automatically in notifyCameraChanged.
-         *
-         *  AutoRadius is turned on by default.
-         *
-		 *  @param radius The positive radius of the element, or a 
-         *          negative/zero value for AutoRadius mode.
-		 */
-        void forceFarRadius (Ogre::Real radius);
-
-        /** Checks if this element is in auto-radius mode.
-         *  While in autoradius mode the element is automatically resized fit
-         *  between the near and far radius.
-         */
-        bool getAutoRadius () const;
-
-        /** Re-enable auto-radius; if disabled.
-         *  Auto-radius is on by default; but can be disabled. This function
-         *  can turn it back on.
-         */
-        void setAutoRadius ();
-
-        /** Camera distances multiplier for the far clipping distance. 
-         *  This threshold will be multiplied with the far clipping distance,
-         *  if the camera doesn't use an infinite far clipping plane.
-         */
-        static const Ogre::Real CAMERA_FAR_DISTANCE_MULTIPLIER;
-
-        /** Camera distances multiplier for the near clipping distance. 
-         *  This threshold will be multiplied with the near clipping distance,
-         *  if the camera does use an infinite far clipping plane.
-         */
-        static const Ogre::Real CAMERA_NEAR_DISTANCE_MULTIPLIER;
-
-    protected:
-        /** Abstract method to set the radius for this elements
-         *  Derived classes should override this and resize their domes.
-         *  The actual radius for the dome is controlled in the base class.
-         */
-        virtual void setFarRadius (Ogre::Real radius);
-    };
-}
-
-#endif // CAELUM__CAMERA_BOUND_ELEMENT_H
diff --git a/extern/caelum/include/CloudSystem.h b/extern/caelum/include/CloudSystem.h
deleted file mode 100644
index ed89943529..0000000000
--- a/extern/caelum/include/CloudSystem.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__CLOUD_SYSTEM_H
-#define CAELUM__CLOUD_SYSTEM_H
-
-#include "CaelumPrerequisites.h"
-
-namespace Caelum
-{
-	/**	A cloud system is implemented by a number of cloud layers.
-	 *	Different cloud layers could implement different kinds of clouds (cirrus, stratus).
-	 */
-	class CAELUM_EXPORT CloudSystem
-	{
-	public:
-		CloudSystem (
-					Ogre::SceneManager *sceneMgr,
-					Ogre::SceneNode *cloudRoot);
-
-		~CloudSystem();
-
-        typedef std::vector<FlatCloudLayer*> LayerVector;
-
-	private:
-		Ogre::SceneManager *mSceneMgr;
-		Ogre::SceneNode *mCloudRoot;
-		LayerVector mLayers;
-
-    public:
-        /** Direct access to the layer vector.
-         */
-        LayerVector& getLayerVector() { return mLayers; }
-
-        /// Clears all cloud layers.
-		void clearLayers();
-
-        /// Create a new cloud layer with default settings at height 0.
-        /// @return pointer to the new layer.
-        FlatCloudLayer* createLayer();
-
-        /// Create a new cloud layer with default settings at a certain height.
-        /// @return pointer to the new layer.
-        FlatCloudLayer* createLayerAtHeight(Ogre::Real height);
-
-        /// Add new layer. Takes ownership of the layer.
-        void addLayer(FlatCloudLayer* layer);
-
-        /// Get a pointer to a certain layer.
-        inline FlatCloudLayer* getLayer(int index) { return mLayers[index]; }
-
-        /// Get the total number of layers.
-        inline int getLayerCount() { return static_cast<int> (mLayers.size ()); }
-
-        /** Update function called every frame from high above.
-         */
-		void update (
-                Ogre::Real timePassed,
-		        const Ogre::Vector3 &sunDirection,
-		        const Ogre::ColourValue &sunLightColour,
-		        const Ogre::ColourValue &fogColour,
-				const Ogre::ColourValue &sunSphereColour);
-
-        /// Similar to @see CaelumSystem::forceSubcomponentQueryFlags.
-        virtual void forceLayerQueryFlags (uint flags);
-
-        /// Similar to @see CaelumSystem::forceSubcomponentVisibilityFlags.
-        virtual void forceLayerVisibilityFlags (uint flags);
-	};
-}
-
-#endif // CAELUM__CLOUD_SYSTEM_H
diff --git a/extern/caelum/include/DepthComposer.h b/extern/caelum/include/DepthComposer.h
deleted file mode 100644
index b71a1e976a..0000000000
--- a/extern/caelum/include/DepthComposer.h
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__DEPTH_COMPOSER_H
-#define CAELUM__DEPTH_COMPOSER_H
-
-#include "CaelumPrerequisites.h"
-#include "FastGpuParamRef.h"
-
-namespace Caelum
-{
-    /** Compositor-based precipitation controller.
-     *  This class will add and control precipitation controllers to viewports.
-     *
-     *  Compositors clone the composing materials. This controller will
-     *  register itself as a compositor listener and change the material in notifyMaterialSetup.
-     */
-	class CAELUM_EXPORT DepthComposer
-	{
-	private:
-		Ogre::SceneManager *mSceneMgr;
-
-        void onCompositorMaterialChanged ();
-        const String& getCompositorName ();
-
-    protected:
-        inline Ogre::SceneManager* getSceneManager() const { return mSceneMgr; }
-
-        friend class DepthComposerInstance;
-
-    public:
-		DepthComposer(Ogre::SceneManager *sceneMgr);
-		virtual ~DepthComposer();
-
-        void update ();
-
-    public:
-        typedef std::map<Ogre::Viewport*, DepthComposerInstance*> ViewportInstanceMap;
-        ViewportInstanceMap mViewportInstanceMap;
-
-    public:
-        DepthComposerInstance* createViewportInstance(Ogre::Viewport* viewport);
-        void destroyViewportInstance(Ogre::Viewport* viewport);
-        DepthComposerInstance* getViewportInstance(Ogre::Viewport* viewport);
-        void destroyAllViewportInstances();
-
-    private:
-        bool mDebugDepthRender;
-
-    public:
-		/// Enables drawing the depth buffer
-		void setDebugDepthRender (bool value);
-		bool getDebugDepthRender () const { return mDebugDepthRender; }
-
-    private:
-        bool mSkyDomeHazeEnabled;
-        Ogre::Vector3 mSunDirection;
-        Ogre::ColourValue mHazeColour;
-
-    public:
-		/// Enables skydome haze.
-		void setSkyDomeHazeEnabled (bool value);
-		bool getSkyDomeHazeEnabled () const { return mSkyDomeHazeEnabled; }
-
-        void setSunDirection (const Ogre::Vector3& value) { mSunDirection = value; }
-        const Ogre::Vector3 getSunDirection () const { return mSunDirection; }
-
-        void setHazeColour (const Ogre::ColourValue& value) { mHazeColour = value; }
-        const Ogre::ColourValue getHazeColour () const { return mHazeColour; }
-
-    private:
-        bool mGroundFogEnabled;
-        Real mGroundFogDensity;
-        Real mGroundFogBaseLevel;
-        Real mGroundFogVerticalDecay;
-        Ogre::ColourValue mGroundFogColour;
-
-    public:
-		/// Enables exponential ground fog.
-		void setGroundFogEnabled (bool value);
-		bool getGroundFogEnabled () const { return mGroundFogEnabled; }
-
-		/// Sets ground fog density
-		void setGroundFogDensity (Real value) { mGroundFogDensity = value; }
-
-		/// Get ground fog density
-		Real getGroundFogDensity () const { return mGroundFogDensity; }
-
-		/// Sets ground fog level
-        /// At ground level fogginess is equal to GroundFogDensity
-		void setGroundFogBaseLevel (Real value) { mGroundFogBaseLevel = value; }
-
-		/// Get ground fog density
-		Real getGroundFogBaseLevel () const { return mGroundFogBaseLevel; }
-
-		/// Sets ground fog vertical decay
-		void setGroundFogVerticalDecay (Real value) { mGroundFogVerticalDecay = value; }
-
-		/// Get ground fog density
-		Real getGroundFogVerticalDecay () const { return mGroundFogVerticalDecay; }
-
-		/// Sets ground fog colour
-		void setGroundFogColour (const Ogre::ColourValue& value) { mGroundFogColour = value; }
-
-		/// Get ground fog colour
-		const Ogre::ColourValue getGroundFogColour () const { return mGroundFogColour; }
-	};
-
-    /** Per-viewport instance of @see DepthComposer
-     *  This will create and control one ogre::CompositorInstance.
-     */
-    class CAELUM_EXPORT DepthComposerInstance: private Ogre::CompositorInstance::Listener
-    {
-    private:
-        DepthComposer* mParent;
-        Ogre::Viewport* mViewport;
-        Ogre::CompositorInstance* mCompInst;
-        std::auto_ptr<DepthRenderer> mDepthRenderer;
-
-        virtual void notifyMaterialSetup(uint pass_id, Ogre::MaterialPtr &mat);
-        virtual void notifyMaterialRender(uint pass_id, Ogre::MaterialPtr &mat);
-
-        struct Params {
-            void setup(Ogre::GpuProgramParametersSharedPtr params);
-
-            Ogre::GpuProgramParametersSharedPtr fpParams;
-            FastGpuParamRef invViewProjMatrix;
-            FastGpuParamRef worldCameraPos;
-            FastGpuParamRef groundFogDensity;
-            FastGpuParamRef groundFogVerticalDecay;
-            FastGpuParamRef groundFogBaseLevel;
-            FastGpuParamRef groundFogColour;
-            FastGpuParamRef sunDirection;
-            FastGpuParamRef hazeColour;
-        } mParams;
-
-    protected:
-        /// Called from DepthComposer::update
-        void _update ();
-
-        void addCompositor ();
-        void removeCompositor ();
-        bool isCompositorEnabled () { return mCompInst != 0; }
-
-        friend class DepthComposer;
-
-    public:
-        /// Get parent DepthComposer; with all the interesting parameters.
-        DepthComposer* getParent() const { return mParent; }
-
-        /// Get the viewport this instance is attached to.
-        Ogre::Viewport* getViewport() const { return mViewport; }
-
-        /// Get compositor instance; attached to the viewport.
-        Ogre::CompositorInstance* getCompositorInstance() const { return mCompInst; }
-
-        /** Get the underlying depth renderer.
-         *  Allow the user to tweak the depth renderer.
-         */
-        Caelum::DepthRenderer* getDepthRenderer () const { return mDepthRenderer.get(); }
-
-        DepthComposerInstance(DepthComposer* parent, Ogre::Viewport* view);
-        virtual ~DepthComposerInstance();
-    };
-    
-    /** Render the depth buffer to a texture.
-     *
-     *  This class tries to be as generic and flexible as possible; but it 
-     *  is currently only used by the depth composer.
-     */
-    class CAELUM_EXPORT DepthRenderer: private Ogre::RenderQueue::RenderableListener
-    {
-    private:
-        Ogre::Viewport* mMasterViewport;
-        Ogre::Viewport* mDepthRenderViewport;
-        Ogre::TexturePtr mDepthRenderTexture;
-        bool mDepthRenderingNow;
-		Ogre::MaterialPtr mDepthRenderMaterial;
-
-        // Override materials during all rendering.
-#if OGRE_VERSION < 0x00010600
-        virtual bool renderableQueued(
-                Ogre::Renderable* rend,
-                Ogre::uint8 groupId,
-                Ogre::ushort priority, 
-                Ogre::Technique** ppTech);
-#else
-        virtual bool renderableQueued(
-                Ogre::Renderable* rend,
-                Ogre::uint8 groupId,
-                Ogre::ushort priority, 
-                Ogre::Technique** ppTech,
-                Ogre::RenderQueue* pQueue);
-#endif // OGRE_VERSION
-        inline Ogre::Material* getDepthRenderMaterial() const { return mDepthRenderMaterial.get(); }
-
-        int mMinRenderGroupId;
-        int mMaxRenderGroupId;
-        int mViewportVisibilityMask;
-
-    public:
-        DepthRenderer (Ogre::Viewport* viewport);
-        ~DepthRenderer ();
-
-        inline Ogre::Viewport* getMasterViewport() { return mMasterViewport; }
-        inline Ogre::Texture* getDepthRenderTexture () { return mDepthRenderTexture.get(); }
-        inline Ogre::Viewport* getDepthRenderViewport () { return mDepthRenderViewport; }
-        inline Ogre::RenderTexture* getDepthRenderTarget () {
-            return mDepthRenderTexture->getBuffer()->getRenderTarget ();
-        }
-
-        /// Render the depth buffer now!
-        void update ();
-
-        /** Render only the render groups in a certain range.
-         *  Call this to only render objects in certain render queue groups.
-         *  The range is inclusive.
-         *  This is a very primitive sort of filter.
-         */
-        void setRenderGroupRangeFilter (int minGroup, int maxGroup);
-
-        /// @see setRenderGroupRangeFilter
-        int getRenderGroupRangeFilterMin () { return mMinRenderGroupId; }
-        int getRenderGroupRangeFilterMax () { return mMaxRenderGroupId; }
-
-        /** Disable the effects of @see setRenderGroupRangeFilter
-         */
-        void disableRenderGroupRangeFilter ();
-
-        /** Query mask for the depth rendering viewport.
-         *  Enforces on every update ();
-         */
-        void setViewportVisibilityMask (uint value) { mViewportVisibilityMask = value; }
-        uint getViewportVisibilityMask () { return mViewportVisibilityMask; }
-        void disableViewportVisibilityMask () { mViewportVisibilityMask = ~0; }
-
-    public:
-        /** If true then use a user-supplied material scheme which outputs depth.
-         *
-         *  The depth output of most materials is obvious and can be guessed most of the time.
-         *  When that fails you can provide a custom material scheme for certain materials which
-         *  renders the depth buffer.
-         *
-         *  This is enabled by default for a scheme called CaelumDepth.
-         */
-        inline void setUseCustomDepthScheme (bool value) { mUseCustomDepthScheme = value; }
-        inline bool getUseCustomDepthScheme () { return mUseCustomDepthScheme; }
-
-        /** Set the name of the custom depth scheme (default is CaelumDepth).
-         */
-        inline void setCustomDepthSchemeName (const Ogre::String& value) { mCustomDepthSchemeName = value; }
-        inline const Ogre::String& getCustomDepthSchemeName () { return mCustomDepthSchemeName; }
-
-        /// Default name of the custom scheme.
-        static const String DEFAULT_CUSTOM_DEPTH_SCHEME_NAME;
-
-    private:
-        bool mUseCustomDepthScheme;
-        Ogre::String mCustomDepthSchemeName;
-    };
-}
-
-#endif // CAELUM__DEPTH_COMPOSER_H
diff --git a/extern/caelum/include/FastGpuParamRef.h b/extern/caelum/include/FastGpuParamRef.h
deleted file mode 100644
index 269d9fca72..0000000000
--- a/extern/caelum/include/FastGpuParamRef.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2009 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__FAST_GPU_PARAM_REF_H
-#define CAELUM__FAST_GPU_PARAM_REF_H
-
-#include "CaelumPrerequisites.h"
-
-namespace Caelum
-{
-    /** @file */ 
-
-    /** Controls if FastGpuParamRef checks pointer match when setting.
-     *  This setting trades safety for performance. By default it's equal to OGRE_DEBUG_MODE.
-     */
-    #define CAELUM_DEBUG_PARAM_REF OGRE_DEBUG_MODE
-
-    /** An optimized reference to a gpu shared parameter.
-     *
-     *  Profiling shows that GpuProgramParameters::_findNamedConstantDefinition is not free.
-     *
-     *  This class avoids hash lookups when updating. It's uses no additional
-     *  memory than if you were to implement the same thing manually.
-     *
-     *  You must also keep the matching Ogre::GpuProgramParametersSharedPtr
-     *  and send it whenever you call FastGpuParamRef::set. This is required
-     *  to save memory in release mode. Debug mode checks the pointer you
-     *  pass to set is the same as the pointer you called bind on; but uses more memory.
-     *
-     *  Also; please note that fetching gpu params from a material every frame is not free either.
-     */
-    class CAELUM_EXPORT FastGpuParamRef
-    {
-    public:
-        /// Default constructor. Starts as unbound
-        FastGpuParamRef(): mPhysicalIndex(InvalidPhysicalIndex)
-        {
-            // mParams needs no initialization; SharedPtrs start as 0.
-        }
-
-        /// Create and bind.
-        FastGpuParamRef(Ogre::GpuProgramParametersSharedPtr paramsPtr, const Ogre::String& name);
-
-        /** Bind to a certain parameter.
-         *
-         *  @param paramsPtr params to bind to. Can't be null; you must unbind explicitly.
-         *  @param name The name of the parameter to bind.
-         *  @param throwIfNotFound Argument to GpuProgramParameters::_findNamedConstantDefinition.
-         *
-         *  If throwIfNotFound is false (the default) missing parameters are
-         *  ignored and the param ref will remand unbound. Calling set will
-         *  then have no effect.
-         */
-        void bind(
-                Ogre::GpuProgramParametersSharedPtr paramsPtr,
-                const Ogre::String& name,
-                bool throwIfNotFound = false);
-
-        /** Unbind ParamRef.
-         *
-         *  If CAELUM_DEBUG_PARAM_REF is 1 this will also release the hold
-         *  on GpuProgramParametersSharedPtr.
-         */
-        void unbind();
-
-        /// Return if this param ref is bound to an actual param.
-        inline bool isBound() const { return mPhysicalIndex != InvalidPhysicalIndex; }
-
-        /// Return the physical index. Only valid if this->isBound().
-        inline size_t getPhysicalIndex () const { return mPhysicalIndex; }
-
-    protected:
-        /** Set the value. No effect if !this->isBound()
-         *  
-         *  @param params Parameter pointer. Can't be null
-         *  @param arg Argument to set.
-         *
-         *  Will check params pointer matches the bound pointer if #CAELUM_DEBUG_PARAM_REF.
-         *  Otherwise a mismatched params pointer can result in memory corruption.
-         */
-        template<typename ArgumentT>
-        inline void doSet(const Ogre::GpuProgramParametersSharedPtr& params, ArgumentT arg) const {
-            #if CAELUM_DEBUG_PARAM_REF
-                assert(params.getPointer() == mParams.getPointer());
-            #endif
-            assert(!params.isNull());
-            if (mPhysicalIndex != InvalidPhysicalIndex) {
-                params->_writeRawConstant(mPhysicalIndex, arg);
-            }
-        }
-
-        template<typename ArgumentT>
-        inline void doSet(const Ogre::GpuProgramParametersSharedPtr& params, ArgumentT arg, size_t count) const {
-            #if CAELUM_DEBUG_PARAM_REF
-                assert(params.getPointer() == mParams.getPointer());
-            #endif
-            assert(!params.isNull());
-            if (mPhysicalIndex != InvalidPhysicalIndex) {
-                params->_writeRawConstant(mPhysicalIndex, arg, count);
-            }
-        }
-
-    public:
-        /// @copydoc FastGpuParamRef::doSet
-        inline void set(const Ogre::GpuProgramParametersSharedPtr& params, int val) const { doSet<int>(params, val); }
-        /// @copydoc FastGpuParamRef::doSet
-        inline void set(const Ogre::GpuProgramParametersSharedPtr& params, Ogre::Real val) const { doSet<Ogre::Real>(params, val); }
-        /// @copydoc FastGpuParamRef::doSet
-        inline void set(const Ogre::GpuProgramParametersSharedPtr& params, const Ogre::Vector3& val) const { doSet<const Ogre::Vector3&>(params, val); }
-        /// @copydoc FastGpuParamRef::doSet
-        inline void set(const Ogre::GpuProgramParametersSharedPtr& params, const Ogre::Vector4& val) const { doSet<const Ogre::Vector4&>(params, val); }
-        /// @copydoc FastGpuParamRef::doSet
-        inline void set(const Ogre::GpuProgramParametersSharedPtr& params, const Ogre::ColourValue& val) const { doSet<const Ogre::ColourValue&>(params, val); }
-        /// @copydoc FastGpuParamRef::doSet
-        inline void set(const Ogre::GpuProgramParametersSharedPtr& params, const Ogre::Matrix4& val) const { doSet<const Ogre::Matrix4*>(params, &val, 1); }
-
-    private:
-        #if CAELUM_DEBUG_PARAM_REF
-            Ogre::GpuProgramParametersSharedPtr mParams;
-        #endif
-        static const size_t InvalidPhysicalIndex = 0xFFFFFFFF;
-        size_t mPhysicalIndex;
-    };
-}
-
-#endif /* CAELUM__FAST_GPU_PARAM_REF_H */
diff --git a/extern/caelum/include/FlatCloudLayer.h b/extern/caelum/include/FlatCloudLayer.h
deleted file mode 100644
index bdd7bcb3ca..0000000000
--- a/extern/caelum/include/FlatCloudLayer.h
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__FLAT_CLOUD_LAYER_H
-#define CAELUM__FLAT_CLOUD_LAYER_H
-
-#include "CaelumPrerequisites.h"
-#include "InternalUtilities.h"
-#include "PrivatePtr.h"
-#include "FastGpuParamRef.h"
-
-namespace Caelum
-{
-    /** A flat cloud layer; drawn as a simple plane.
-     *  Supports movement and variable cloud cover.
-     *  
-     *  There are significant incompatible difference between this and the
-     *  LayeredClouds from version 0.3. This implementation of clouds is
-     *  positioned in world space while the old implementation was a curved
-     *  plane moving with the camera. It is not possible to perfectly simulate
-     *  the older implementation.
-     *
-     *  @note This is tighly integrated with LayeredCloud.cg and LayeredClouds.material.
-     */
-	class CAELUM_EXPORT FlatCloudLayer
-	{
-	public:
-		FlatCloudLayer(
-				Ogre::SceneManager *sceneMgr,
-                Ogre::SceneNode *cloudRoot);
-
-		~FlatCloudLayer();
-
-        /** Update function called each frame from above.
-         *  This can be reproduced with calls to other public functions.
-         */
-	    void update (
-                Ogre::Real timePassed,
-		        const Ogre::Vector3 &sunDirection,
-		        const Ogre::ColourValue &sunLightColour,
-		        const Ogre::ColourValue &fogColour,
-				const Ogre::ColourValue &sunSphereColour);
-
-        /// Advance cloud animation (the time part of FlatCloudLayer::update).
-        void advanceAnimation (Ogre::Real timePassed);
-
-        /** Reset most tweak settings to their default values
-         */
-        void reset ();
-
-	private:
-	    Ogre::Vector2 mCloudSpeed;
-	    Ogre::Vector2 mCloudMassOffset;
-	    Ogre::Vector2 mCloudDetailOffset;
-
-        // Set texture offsets.
-        // Animated every frame.
-	    void setCloudMassOffset(const Ogre::Vector2 &cloudMassOffset);
-	    void setCloudDetailOffset(const Ogre::Vector2 &cloudDetailOffset);
-
-    public:
-        /** Sets cloud movement speed.
-		 *  @param cloudSpeed Cloud movement speed.
-		 */
-		void setCloudSpeed (const Ogre::Vector2 &cloudSpeed);
-
-		/** Gets cloud movement speed.
-		 *  @param cloudSpeed Cloud movement speed.
-		 */
-        const Ogre::Vector2 getCloudSpeed () const { return mCloudSpeed; }
-
-    private:
-        Ogre::Vector3 mSunDirection; 
-        Ogre::ColourValue mSunLightColour; 
-        Ogre::ColourValue mSunSphereColour; 
-        Ogre::ColourValue mFogColour; 
-
-    public:
-	    void setSunDirection(const Ogre::Vector3 &sunDirection);
-	    void setSunLightColour(const Ogre::ColourValue &sunLightColour);
-		void setSunSphereColour(const Ogre::ColourValue &sunSphereColour);
-	    void setFogColour(const Ogre::ColourValue &fogColour);
-        const Ogre::Vector3 getSunDirection () const; 
-        const Ogre::ColourValue getSunLightColour () const; 
-        const Ogre::ColourValue getSunSphereColour () const; 
-        const Ogre::ColourValue getFogColour () const; 
-
-    private:
-        /// Pointer to scene manager.
-	    Ogre::SceneManager *mSceneMgr;
-
-        // Note: objects are destroyed in reverse order of declaration.
-        // This means that objects must be ordered by dependency.
-
-        /// Cloned cloud material.
-	    PrivateMaterialPtr mMaterial;		
-
-        struct Params
-        {
-            void setup(Ogre::GpuProgramParametersSharedPtr fpParams, Ogre::GpuProgramParametersSharedPtr vpParams);
-
-            Ogre::GpuProgramParametersSharedPtr vpParams;
-            Ogre::GpuProgramParametersSharedPtr fpParams;
-
-            FastGpuParamRef cloudCoverageThreshold;
-            FastGpuParamRef cloudMassOffset;
-            FastGpuParamRef cloudDetailOffset;
-            FastGpuParamRef cloudMassBlend;
-            FastGpuParamRef vpSunDirection;
-            FastGpuParamRef fpSunDirection;
-            FastGpuParamRef sunLightColour;
-            FastGpuParamRef sunSphereColour;
-            FastGpuParamRef fogColour;
-            FastGpuParamRef layerHeight;
-            FastGpuParamRef cloudUVFactor;
-            FastGpuParamRef heightRedFactor;
-            FastGpuParamRef nearFadeDist;
-            FastGpuParamRef farFadeDist;
-            FastGpuParamRef fadeDistMeasurementVector;
-        } mParams;
-
-    private:
-        PrivateMeshPtr mMesh;
-	    PrivateSceneNodePtr mNode;
-	    PrivateEntityPtr mEntity;
-
-        // Mesh parameters.
-        bool mMeshDirty;
-        Real mMeshWidth, mMeshHeight;
-        int mMeshWidthSegments, mMeshHeightSegments;
-
-    public:
-        /** Regenerate the plane mesh and recreate entity.
-         *  This automatically happens in update.
-         */
-        void _ensureGeometry();
-
-        /** Regenerate the plane mesh and recreate entity.
-         *  This automatically happens when mesh parameters are changed.
-         */
-        void _invalidateGeometry();
-
-        /** Reset all mesh parameters.
-         */
-        void setMeshParameters (
-                Real meshWidth, Real meshHeight,
-                int meshWidthSegments, int meshHeightSegments);
-
-        /// @see setMeshParameters
-        inline void setMeshWidth (Real value) { mMeshWidth = value; _invalidateGeometry (); }
-        inline void setMeshHeight (Real value) { mMeshHeight = value; _invalidateGeometry (); }
-        inline void setMeshWidthSegments (int value) { mMeshWidthSegments = value; _invalidateGeometry (); }
-        inline void setMeshHeightSegments (int value) { mMeshHeightSegments = value; _invalidateGeometry (); }
-        inline Real getMeshWidth () const { return mMeshWidth; }
-        inline Real getMeshHeight () const { return mMeshHeight; }
-        inline int getMeshWidthSegments () const { return mMeshWidthSegments; }
-        inline int getMeshHeightSegments () const { return mMeshHeightSegments; }
-
-    private:
-        /// Lookup used for cloud coverage, @see setCloudCoverLookup.
-        std::auto_ptr<Ogre::Image> mCloudCoverLookup;
-
-        /// Filename of mCloudCoverLookup
-        Ogre::String mCloudCoverLookupFileName;
-
-        /// Value passed to setCloudCover (before lookup).
-	    Ogre::Real mCloudCover;
-
-    public:
-		/** Sets cloud cover, between 0 (completely clear) and 1 (completely covered)
-		 *  @param cloudCover Cloud cover between 0 and 1
-		 */
-		void setCloudCover (const Ogre::Real cloudCover);
-
-		/** Gets the current cloud cover.
-		 *  @return Cloud cover, between 0 and 1
-		 */
-        inline Ogre::Real getCloudCover () const { return mCloudCover; }
-
-        /** Set the image used to lookup the cloud coverage threshold.
-         *  This image is used to calculate the cloud coverage threshold
-         *  based on the desired cloud cover.
-         *
-         *  The cloud coverage threshold is substracted from cloud intensity
-         *  at any point; to generate fewer or more clouds. That threshold is
-         *  not linear, a lookup is required to ensure that setCloudCover(0.1)
-         *  will actually have 10% the clouds at setCloudCover(1).
-         *
-         *  The lookup is the inverse of the sum on the histogram, and was
-         *  calculated with a small hacky tool.
-         */
-	    void setCloudCoverLookup (const Ogre::String& fileName);
-
-        /** Get the filename of the cloud cover lookup image.
-         *  This returns the value set by setCloudCoverLookup or an empty
-         *  string if disabled.
-         */
-        const Ogre::String getCloudCoverLookupFileName () const;
-
-        /** Disable any cloud cover lookup.
-         *  @see setCloudCoverLookup.
-         */
-        void disableCloudCoverLookup ();
-
-    private:
-        Ogre::Real mCloudCoverVisibilityThreshold;
-
-    protected:
-        /** Enforce setCloudCoverVisibilityThreshold.
-         */
-        void _updateVisibilityThreshold ();
-
-    public:
-        /// Get cloud cover visiblity threshold.
-        /// Beneath this cloud coverage nothing is drawn anymore.
-        Ogre::Real getCloudCoverVisibilityThreshold () const { return mCloudCoverVisibilityThreshold; }
-
-        /** Set cloud cover visiblity threshold.
-         *
-         *  Beneath this cloud coverage nothing is drawn anymore.
-         *  Default value is very very low (0.001). All this does is save you from
-         *  destroying/recreating layers when they're too thin to bother drawing.
-         */
-        void setCloudCoverVisibilityThreshold (const Ogre::Real value);
-
-    private:
-        /// Height of this cloud layer; equal to node's y position.
-        Ogre::Real mHeight;
-
-    public:
-        /** Set the height of the cloud layer.
-         *  @param height In world units above the cloud root node.
-         */
-        void setHeight(Ogre::Real height);
-
-        /** Get the height of the cloud layer.
-         *  @return height In world units above the cloud root node.
-         */
-        Ogre::Real getHeight() const;
-
-    private:
-		/// Current cloud blend position; from 0 to mNoiseTextureNames.size()
-	    Ogre::Real mCloudBlendPos;
-
-        /// Current index in the set of textures.
-        /// Cached to avoid setting textures every frame.
-        int mCurrentTextureIndex;
-
-        /// Time required to blend two cloud shapes.
-	    Ogre::Real mCloudBlendTime;
-
-        /// Names of noise textures.
-        std::vector<String> mNoiseTextureNames;
-
-    public:
-	    /** Sets the time it takes to blend two cloud shaped together, in seconds.
-         *  This will also reset the animation at the current time.
-		 *  @param value Cloud shape blend time in seconds
-		 */
-		void setCloudBlendTime (const Ogre::Real value);
-
-		/** Gets the time it takes to blend two cloud shaped together, in seconds.
-		 *  @return Cloud shape blend time in seconds
-		 */
-		Ogre::Real getCloudBlendTime () const;
-
-        /** Set the current blending position; between noise textures.
-         *  Integer values are used for single textures. Float values blend between two textures.
-         *  Values outside [0, textureCount) are wrapped around.
-         *  @param value New cloud blending position
-         */
-	    void setCloudBlendPos (const Ogre::Real value);
-
-        /// @see setCloudBlendPos
-        Ogre::Real getCloudBlendPos () const;
-
-    private:
-        Ogre::Real mCloudUVFactor;
-
-    public:
-        /** Cloud texture coordinates are multiplied with this.
-         *  Higher values result in more spread-out clouds.
-         *  Very low value result in ugly texture repeats.
-         */
-	    void setCloudUVFactor (const Ogre::Real value);
-        /// @see setCloudUVFactor
-        inline Ogre::Real getCloudUVFactor () const { return mCloudUVFactor; }
-
-    private:
-        Ogre::Real mHeightRedFactor;
-
-    public:
-        /** High-altitude clouds are tinted red in the evening.
-         *  Higher values attenuate the effect.
-         */
-	    void setHeightRedFactor (const Ogre::Real value);
-        /// @see setCloudUVFactor
-        Ogre::Real getHeightRedFactor () const { return mHeightRedFactor; }
-
-    private:
-        Ogre::Real mNearFadeDist;
-        Ogre::Real mFarFadeDist;
-        Ogre::Vector3 mFadeDistMeasurementVector;
-
-    public:
-        /** Cloud fade distances.
-         *
-         *  These are measured horizontally in meters (height is not used).
-         *
-         *  The effect is a fade based on alpha blending which occurs between
-         *  nearValue and farValue. After farValue nothing is visibile from
-         *  this layer.
-         *
-         *  Default values are 10000 and 140000
-         */
-        void setFadeDistances (Ogre::Real nearValue, Ogre::Real farValue);
-
-        /// Set only near fade distance (see setFadeDistances).
-	    void setNearFadeDist (const Ogre::Real value);
-        /// Get near fade distance (see setFadeDistances).
-        Ogre::Real getNearFadeDist () const { return mNearFadeDist; }
-
-        /// Set only far fade distance (see setFadeDistances).
-	    void setFarFadeDist (const Ogre::Real value);
-        /// Get fade distance (see setFadeDistances).
-        Ogre::Real getFarFadeDist () const { return mFarFadeDist; }
-
-        /** Set on which components is the fade distance measured.
-         *  
-         *  Default is Vector3(0, 1, 1) which measures fade distance
-         *  horizontally in caelum's default assumed coordinate system.
-         *
-         *  If you're in a Z-up system you probably want to set this to (1, 1, 0).
-         *
-         *  Fade distance is always measured relative to the camera.
-         */
-        void setFadeDistMeasurementVector (const Ogre::Vector3& value);
-        /// Get the value set by setFadeDistMeasurementVector.
-        const Ogre::Vector3 getFadeDistMeasurementVector () const { return mFadeDistMeasurementVector; }
-
-    public:
-        void setQueryFlags (uint flags) { mEntity->setQueryFlags (flags); }
-        uint getQueryFlags () const { return mEntity->getQueryFlags (); }
-        void setVisibilityFlags (uint flags) { mEntity->setVisibilityFlags (flags); }
-        uint getVisibilityFlags () const { return mEntity->getVisibilityFlags (); }
-	};
-}
-
-#endif // CAELUM__FLAT_CLOUD_LAYER_H
diff --git a/extern/caelum/include/GroundFog.h b/extern/caelum/include/GroundFog.h
deleted file mode 100644
index 6e244f5aaf..0000000000
--- a/extern/caelum/include/GroundFog.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef GROUNDFOG_H
-#define GROUNDFOG_H
-
-#include "CaelumPrerequisites.h"
-#include "CameraBoundElement.h"
-#include "PrivatePtr.h"
-#include "FastGpuParamRef.h"
-
-namespace Caelum
-{
-    /** Exponential ground fog system implementation.
-     *
-     *  This class controls CaelumGroundFog passes in a potentially large number
-     *  of materials, changing shader program parameters. This class keeps a list
-     *  of passes to control; which can be build based on pass name.
-     *
-     *  This simulates a field of fog where "absorption" at a certain point is
-     *	exp(-verticalDecay * (h - fogLevel)). This absorption is multiplicative,
-     *	the total fog alpha is e^(-density * absorption_on_view_path).
-     *
-     *	You can set verticalDecay to 0 and get standard GL_EXP fog. Don't actually
-     *	do that though because you'll get a division by 0.
-     *
-     *  @note: This is deprecated starting from Caelum 0.4. The DepthComposer class
-     *  provides similar functionality with less intrusion on your materials.
-     */
-    class CAELUM_EXPORT GroundFog: public CameraBoundElement
-    {
-	public:
-		static const Ogre::String DEFAULT_PASS_NAME;
-
-		/** Constructor.
-		 */
-		GroundFog (Ogre::SceneManager *scene,
-			Ogre::SceneNode *caelumRootNode,
-			const Ogre::String &domeMaterialName = "CaelumGroundFogDome",
-			const Ogre::String &domeEntityName = "CaelumGroundFogDome");
-
-		/** Virtual destructor.
-		 */
-		virtual ~GroundFog ();
-
-		/** Typedef for easier manipulation of a set of Passes.
-		 */
-		typedef std::set<Ogre::Pass *> PassSet;
-
-		/** Get the set of currently controlled passes.
-		 *	This is provided if you really want to change the set by hand.
-		 *  You should call forceUpdate after modifying this set.
-		 */
-		PassSet& getPasses();
-
-		/** Get the set of currently controlled passes.
-		 *  This is a const overload which doesn't let you modify the
-		 *	underlying collection.
-		 */
-		const PassSet& getPasses () const;
-
-		/** Find caelum fog passes to control by name.
-		 *	By default this looks for passes called "CaleumGroundFog".
-		 *	@note This calls forceUpdate()
-		 */
-		void findFogPassesByName (const Ogre::String& passName = DEFAULT_PASS_NAME);
-
-		/// Sets the fog density multiplier
-		void setDensity (Ogre::Real density);
-
-		/// Get the fog density multiplier
-		Ogre::Real getDensity () const;
-
-		/// Sets fog colour
-		void setColour (const Ogre::ColourValue &colour);
-
-		/// Gets fog colour
-		const Ogre::ColourValue getColour () const;
-
-		/// Sets the vertical fog decay constant.
-		void setVerticalDecay (Ogre::Real verticalDecay);
-
-		/// Get the vertical fog decay constant.
-		Ogre::Real getVerticalDecay () const;
-
-		/** Sets the ground level.
-		 *	At ground level 'fogginess' is equal to 1.
-		 */
-		void setGroundLevel (Ogre::Real GroundLevela);
-
-		/** Get the ground level.
-		 */
-		Ogre::Real getGroundLevel () const;
-
-		/** Forces an update of all the passes. You have to use this if you modify
-		 *	the set of passes by hand, otherwise avoid it.
-		 */
-		void forceUpdate ();
-
-	private:
-		/// Cached Density
-		Ogre::Real mDensity;
-
-		/// Cached VerticalDecay
-		Ogre::Real mVerticalDecay;
-
-		/// Cached GroundLevel
-		Ogre::Real mGroundLevel;
-
-        /// Fog colour
-		Ogre::ColourValue mFogColour;
-
-    private:
-		/// The scene to control fog in.
-		Ogre::SceneManager* mScene;
-
-		/// Sky dome material
-		PrivateMaterialPtr mDomeMaterial;
-        
-		/// Sky dome node
-		PrivateSceneNodePtr mDomeNode;
-
-		/// Sky dome entity
-		PrivateEntityPtr mDomeEntity;
-
-		// Called whenever something changes to update the sky dome.
-		void updateSkyFogging();
-
-    protected:
-        /// Handle far radius.
-	    virtual void setFarRadius (Ogre::Real radius);
-
-    public:
-		/// Handle camera change.
-		virtual void notifyCameraChanged (Ogre::Camera *cam);
-
-        void setQueryFlags (uint flags) { mDomeEntity->setQueryFlags (flags); }
-        uint getQueryFlags () const { return mDomeEntity->getQueryFlags (); }
-        void setVisibilityFlags (uint flags) { mDomeEntity->setVisibilityFlags (flags); }
-        uint getVisibilityFlags () const { return mDomeEntity->getVisibilityFlags (); }
-
-    private:
-		/// The passes to control.
-		PassSet mPasses;
-
-        /// Params references.
-        struct FogParamsBase
-        {
-            void setup(Ogre::GpuProgramParametersSharedPtr fpParams);
-
-            Ogre::GpuProgramParametersSharedPtr fpParams;
-
-    		FastGpuParamRef fogDensity;
-		    FastGpuParamRef fogColour;
-		    FastGpuParamRef fogVerticalDecay;
-		    FastGpuParamRef fogGroundLevel;
-
-        };
-
-        struct DomeFogParams: public FogParamsBase {
-            void setup(Ogre::GpuProgramParametersSharedPtr fpParams);
-		    FastGpuParamRef cameraHeight;
-        } mDomeParams;
-
-        struct PassFogParams: public FogParamsBase {
-            PassFogParams(Ogre::GpuProgramParametersSharedPtr fpParams) { setup(fpParams); }
-
-            static inline bool lessThanByParams(const PassFogParams& a, const PassFogParams& b) {
-                return a.fpParams.get() <= b.fpParams.get();
-            }
-
-            static inline bool equalByParams(const PassFogParams& a, const PassFogParams& b) {
-                return a.fpParams.get() == b.fpParams.get();
-            }
-        };
-
-        typedef std::vector<PassFogParams> PassFogParamsVector;
-        PassFogParamsVector mPassFogParams;
-
-        /// Update mPassFogParams based on mPasses
-        void updatePassFogParams();
-    };
-}
-
-#endif //GROUNDFOG_H
diff --git a/extern/caelum/include/ImageStarfield.h b/extern/caelum/include/ImageStarfield.h
deleted file mode 100644
index 7dcec0c589..0000000000
--- a/extern/caelum/include/ImageStarfield.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__IMAGE_STARFIELD_H
-#define CAELUM__IMAGE_STARFIELD_H
-
-#include "CaelumPrerequisites.h"
-#include "CameraBoundElement.h"
-#include "PrivatePtr.h"
-
-namespace Caelum
-{
-    /** Image-based starfield class.
-     *  This class implements a starfield based on mapping a single large
-     *  texture on a sphere. @see PointStarfield for a better solution.
-     */
-    class CAELUM_EXPORT ImageStarfield : public CameraBoundElement
-    {
-	protected:
-		/// Reference to the dome node.
-		PrivateSceneNodePtr mNode;
-
-		/// Reference to the (cloned) starfield material.
-		PrivateMaterialPtr mStarfieldMaterial;
-
-		/// Reference to the dome entity.
-		PrivateEntityPtr mEntity;
-
-		/// Name of the spheric dome resource.
-		static const Ogre::String STARFIELD_DOME_NAME;
-
-		/// Name of the starfield material.
-		static const Ogre::String STARFIELD_MATERIAL_NAME;
-
-		/** Inclination of the starfield.
-		 */
-		Ogre::Degree mInclination;
-
-	public:
-        static const String DEFAULT_TEXTURE_NAME;
-
-		/** Constructor.
-			@param sceneMgr The scene manager this dome will belong to.
-		 */
-		ImageStarfield (
-                Ogre::SceneManager *sceneMgr,
-				Ogre::SceneNode *caelumRootNode,
-                const Ogre::String &textureName = DEFAULT_TEXTURE_NAME);
-
-		/** Destructor.
-		 */
-		virtual ~ImageStarfield ();
-
-		/** Sets the starfield inclination. This inclination is the angle between the starfield rotation axis and the horizon plane.
-			@param inc The starfield inclination in degrees. It`s equal to observer latitude taken with opposite sign.
-		 */
-		void setInclination (Ogre::Degree inc);
-
-		/** Updates the starfield position/orientation.
-			@param time Local time in [0, 1] range.
-		 */
-		void update (const float time);
-
-		/** Updates the starfield material.
-			@param mapName The new starfield texture map name.
-		 */
-		void setTexture (const Ogre::String &mapName);
-
-    public:
-		/// Handle camera change.
-		virtual void notifyCameraChanged (Ogre::Camera *cam);
-
-    protected:
-        /// Handle far radius.
-	    virtual void setFarRadius (Ogre::Real radius);
-
-    public:
-        void setQueryFlags (uint flags) { mEntity->setQueryFlags (flags); }
-        uint getQueryFlags () const { return mEntity->getQueryFlags (); }
-        void setVisibilityFlags (uint flags) { mEntity->setVisibilityFlags (flags); }
-        uint getVisibilityFlags () const { return mEntity->getVisibilityFlags (); }
-    };
-}
-
-#endif // CAELUM__IMAGE_STARFIELD_H
diff --git a/extern/caelum/include/InternalUtilities.h b/extern/caelum/include/InternalUtilities.h
deleted file mode 100644
index 5c20b3abc5..0000000000
--- a/extern/caelum/include/InternalUtilities.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM_HEADER__PRIVATE_UTILITIES_H
-#define CAELUM_HEADER__PRIVATE_UTILITIES_H
-
-#include "CaelumPrerequisites.h"
-#include "PrivatePtr.h"
-
-namespace Caelum
-{
-    /** Private caelum utilities
-     *
-     *  This class constains various tiny utilities for caelum to use.
-     */
-    class CAELUM_EXPORT InternalUtilities
-    {
-    public:
-        /** Gets the interpolated colour between two pixels from an image.
-            Interpolate a texture pixel by hand. (fx, fy) are in texture coordinates,
-            ranging [0-1] across the entire texture.
-            Smooth blending is only done on the x coordinate.
-            Wrapping is only supported on X as well.
-
-            @param fx Horizontal coordinate.
-            @param fy Vertical coordiate.
-            @param img The lookup image.
-            @param wrapX To wrap the x coordinate.
-            @return The interpolated colour.
-         */
-        static Ogre::ColourValue getInterpolatedColour (
-                float fx,
-                float fy,
-                Ogre::Image *img,
-                bool wrapX = true);
-
-        /** Quickly format a pointer as a string; in hex
-         */
-        static const Ogre::String pointerToString(void* pointer);
-
-        /** Creates a private clone of a material from a script.
-         *
-         *  When a class wants to modify a material at runtime it must not
-         *  modify the original material loaded from scripts. Instead it
-         *  should create a clone and use that.
-         *
-         *  This method throws a Caelum::UnsupportedException on failure.
-         *  
-         *  @param originalName Name of the original material.
-         *  @param cloneName Name of the result clone.
-         *
-         *  @return A pointer to an unique material.
-         */
-        static Ogre::MaterialPtr checkLoadMaterialClone (
-                const Ogre::String& originalName,
-                const Ogre::String& cloneName);
-
-        /** Fetch a compositor by name and check it can be loaded properly
-         *
-         *  This method throws a Caelum::UnsupportedException on failure.
-         *
-         *  @param name Name of the compositor to check.
-         *
-         *  @return A pointer to the compositor (can be ignored)
-         */
-        static Ogre::CompositorPtr checkCompositorSupported (const Ogre::String& name);
-
-	public:
-		/** Enumeration of types of sky domes.
-		 */
-		enum DomeType {
-            DT_SKY_DOME,
-            DT_IMAGE_STARFIELD,
-        };
-
-		/** Creates a longitude-latitude sky dome.
-		 *  @note Does nothing if the sphere already exists.
-		 *  @param name The name of the mesh to be created.
-		 *  @param segments The number of sphere segments.
-		 *  @param domeType The type of dome to create.
-		 */
-		static void generateSphericDome (const Ogre::String &name, int segments, DomeType domeType);
-
-	private:
-		/** Fills the vertex and index buffers for a sky gradients type dome.
-		 *  @param pVertex Pointer to the vertex buffer.
-		 *  @param pIndices Pointer to the index buffer.
-		 *  @param segments Subdivision detail.
-		 */
-		static void fillGradientsDomeBuffers (float *pVertex, unsigned short *pIndices, int segments);
-
-		/** Fills the vertex and index buffers for a stardield type dome.
-		 *  @param pVertex Pointer to the vertex buffer.
-		 *  @param pIndices Pointer to the index buffer.
-		 *  @param segments Subdivision detail.
-		 */
-		static void fillStarfieldDomeBuffers (float *pVertex, unsigned short *pIndices, int segments);
-    };
-}
-
-#endif // CAELUM_HEADER__PRIVATE_UTILITIES_H
diff --git a/extern/caelum/include/Moon.h b/extern/caelum/include/Moon.h
deleted file mode 100644
index 0f0c27586d..0000000000
--- a/extern/caelum/include/Moon.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__MOON_H
-#define CAELUM__MOON_H
-
-#include "CaelumPrerequisites.h"
-#include "SkyLight.h"
-#include "FastGpuParamRef.h"
-#include "PrivatePtr.h"
-
-namespace Caelum
-{
-    /** Class representing the moon.
-     *  Drawn as two billboards; one after the stars and one after the skydome.
-     *  Drawing it before the skydome will make it invisible in daylight; and that's bad.
-     */
-    class CAELUM_EXPORT Moon:
-            public BaseSkyLight
-    {
-	public:
-		/// Name of the moon material.
-		static const Ogre::String MOON_MATERIAL_NAME;
-
-        /// Name of the moon background material.
-		static const Ogre::String MOON_BACKGROUND_MATERIAL_NAME;
-
-	private:
-        /// Material for MoonBB
-		PrivateMaterialPtr mMoonMaterial;
-
-		/// The moon sprite.
-		PrivateBillboardSetPtr mMoonBB;
-
-        /// Material for mBackBB
-		PrivateMaterialPtr mBackMaterial;
-		
-        /// The moon's background; used to block the stars.
-		PrivateBillboardSetPtr mBackBB;
-
-		/// The moon sprite visible angle
-		Ogre::Degree mAngularSize;
-
-        struct Params {
-            void setup(Ogre::GpuProgramParametersSharedPtr fpParams);
-
-            Ogre::GpuProgramParametersSharedPtr fpParams;
-            FastGpuParamRef phase;
-        } mParams;
-
-	public:
-		/** Constructor.
-		 */
-		Moon (
-				Ogre::SceneManager *sceneMgr,
-				Ogre::SceneNode *caelumRootNode,
-				const Ogre::String& moonTextureName = "moon_disc.dds", 
-				Ogre::Degree angularSize = Ogre::Degree(3.77f));
-
-		virtual ~Moon ();
-
-		/** Updates the moon material.
-			@param textureName The new moon texture name.
-		 */
-		void setMoonTexture (const Ogre::String &textureName);
-		
-		/** Updates the moon size.
-			@param moon TextureAngularSize The new moon texture angular size.
-		 */
-		void setMoonTextureAngularSize(const Ogre::Degree& moonTextureAngularSize);
-
-		/** Sets the moon sphere colour.
-			@param colour The colour used to draw the moon
-		 */
-		void setBodyColour (const Ogre::ColourValue &colour);
-
-		/// Set the moon's phase
-		void setPhase (Ogre::Real phase);
-
-    public:
-		/// Handle camera change.
-		virtual void notifyCameraChanged (Ogre::Camera *cam);
-
-        virtual void setQueryFlags (uint flags);
-        virtual uint getQueryFlags () const;
-        virtual void setVisibilityFlags (uint flags);
-        virtual uint getVisibilityFlags () const;
-    };
-}
-
-#endif // CAELUM__MOON_H
diff --git a/extern/caelum/include/PointStarfield.h b/extern/caelum/include/PointStarfield.h
deleted file mode 100644
index c7bf5156ac..0000000000
--- a/extern/caelum/include/PointStarfield.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__POINT_STARFIELD_H
-#define CAELUM__POINT_STARFIELD_H
-
-#include "CaelumPrerequisites.h"
-#include "CameraBoundElement.h"
-#include "PrivatePtr.h"
-#include "FastGpuParamRef.h"
-
-namespace Caelum
-{
-    /** POD for bright star catalogue entries.
-     *  Only J2000 position and magnitude included.
-     */
-    struct BrightStarCatalogueEntry {
-        signed char rasc_hour;
-        signed char rasc_min;
-        float rasc_sec;
-        signed char decl_deg;
-        signed char decl_min;
-        float decl_sec;
-        float magn;
-    };
-
-    /// There are exactly 9110 stars in our version of the BSC.
-    const int BrightStarCatalogueSize = 9110;
-
-    /// Hardcoded bright star catalogue (BrightStarCatalogue.cpp)
-    extern const BrightStarCatalogueEntry BrightStarCatalogue[BrightStarCatalogueSize];
-
-    /** Point starfield class.
-     *  An Ogre::ManualObject is used for drawing because billboards are too slow.
-     *
-     *  Stars are sized in pixels; this seems to work a lot better than relative sizes.
-     *  Stars could be made even smaller but it would require hinting (nudging pixel
-     *  coordinates to match actual screen pixels). Points are hard.
-     * 
-     *  Loading a bright-star catalogue is supported but star positions are
-     *  likely only correct relative to each other. External rotation is probably wrong.
-     */
-    class CAELUM_EXPORT PointStarfield:
-            public CameraBoundElement
-    {
-    public:
-	    /** Constructor.
-         *  By default this loads some reasonable defaults and the
-         *  bright star catalogue.
-         */
-	    PointStarfield (
-                Ogre::SceneManager *sceneMgr,
-			    Ogre::SceneNode *caelumRootNode,
-                bool initWithCatalogue = true);
-
-	    /// Destructor.
-	    virtual ~PointStarfield ();
-
-        /// Struct representing one star inside PointStarfield.
-        struct Star {
-            Ogre::Degree RightAscension;
-            Ogre::Degree Declination;
-            Ogre::Real Magnitude;
-        };
-
-        /// A vector of Star
-        typedef std::vector<Star> StarVector;
-
-        /** Get a reference to the vector of stars.
-         *  You can freely modify this; but you need to updateStars when you're done.
-         */
-        inline StarVector& getStarVector () { return mStars; }
-
-        /** You must call this if you change the star vector by hand.
-         */
-        void notifyStarVectorChanged ();
-
-        /// Clear any and all stars.
-        void clearAllStars ();
-
-        /** Add a bunch of random stars.
-         */
-        void addRandomStars (int count);
-
-        /** Add one star from the bright star catalogue.
-         */
-        void addStar (const BrightStarCatalogueEntry &entry);
-
-        /** Add stars from the bright star catalogue.
-         *  @param count Number of stars to add (in order of brightness).
-         */
-        void addBrightStarCatalogue (int count = BrightStarCatalogueSize);
-
-    private:
-        /// Cloned material
-        PrivateMaterialPtr mMaterial;
-
-	    /// Node for the starfield
-	    PrivateSceneNodePtr mNode;
-        
-        /// Manual object for drawing.
-        PrivateManualObjectPtr mManualObj;
-
-        /// Star data.
-        std::vector<Star> mStars;
-
-        Ogre::Real mMinPixelSize, mMaxPixelSize, mMag0PixelSize;
-        Ogre::Real mMagnitudeScale;
-
-        Ogre::Degree mObserverLatitude, mObserverLongitude;
-
-        bool mValidGeometry;
-		void invalidateGeometry();
-		void ensureGeometry();
-
-    public:
-	    /** Update function; called from CaelumSystem::updateSubcomponents
-            @param time Time of the day.
-	     */
-	    void _update (float time);
-
-        /** Magnitude power scale.
-         *  Star magnitudes are logarithming; one magnitude difference
-         *  means a star is 2.512 times brighter.
-         *  This property allows tweaking that value.
-         */
-        inline void setMagnitudeScale (Ogre::Real value) { mMagnitudeScale = value; }
-        inline Ogre::Real getMagnitudeScale () const { return mMagnitudeScale; }
-
-        inline void setMag0PixelSize (Ogre::Real value) { mMag0PixelSize = value; }
-        inline Ogre::Real getMag0PixelSize () const { return mMag0PixelSize; }
-
-        inline void setMinPixelSize (Ogre::Real value) { mMinPixelSize = value; }
-        inline Ogre::Real getMinPixelSize () const { return mMinPixelSize; }
-
-        inline void setMaxPixelSize (Ogre::Real value) { mMaxPixelSize = value; }
-        inline Ogre::Real getMaxPixelSize () const { return mMaxPixelSize; }
-
-        void setObserverLatitude (Ogre::Degree value);
-        inline Ogre::Degree getObserverLatitude () const { return mObserverLatitude; }
-
-        void setObserverLongitude (Ogre::Degree value);
-        inline Ogre::Degree getObserverLongitude () const { return mObserverLongitude; }
-
-    private:
-        Ogre::Degree mObserverPositionRebuildDelta;
-
-    public:
-        /** Moving the observer position around causes a starfield rebuild.
-         *  Default value (DEFAULT_OBSERVER_POSITION_REBUILD_DELTA) is 0.1
-         *  degrees which is equivalent to around 170 meters on the earth.
-         *
-         *  This only matters if you compute the observer position every
-         *  frame. Caelum doesn't contain code for that.
-         */
-        inline Ogre::Degree getObserverPositionRebuildDelta () const {
-            return mObserverPositionRebuildDelta;
-        }
-        inline void setObserverPositionRebuildDelta (Ogre::Degree value) {
-            mObserverPositionRebuildDelta = value;
-        }
-
-	    static const Ogre::Degree DEFAULT_OBSERVER_POSITION_REBUILD_DELTA;
-
-        /// Material used to draw all the points.
-	    static const Ogre::String STARFIELD_MATERIAL_NAME;
-
-	    /// Handle camera change.
-	    virtual void notifyCameraChanged (Ogre::Camera *cam);
-
-    protected:
-        /// Handle far radius.
-        virtual void setFarRadius (Ogre::Real radius);
-
-    public:
-        void setQueryFlags (uint flags) { mManualObj->setQueryFlags (flags); }
-        uint getQueryFlags () const { return mManualObj->getQueryFlags (); }
-        void setVisibilityFlags (uint flags) { mManualObj->setVisibilityFlags (flags); }
-        uint getVisibilityFlags () const { return mManualObj->getVisibilityFlags (); }
-
-    private:
-        struct Params {
-            void setup(Ogre::GpuProgramParametersSharedPtr vpParams);
-        
-            Ogre::GpuProgramParametersSharedPtr vpParams;
-            FastGpuParamRef mag_scale;
-            FastGpuParamRef mag0_size;
-            FastGpuParamRef min_size;
-            FastGpuParamRef max_size;
-            FastGpuParamRef aspect_ratio;
-        } mParams;
-    };
-}
-
-#endif // CAELUM__POINT_STARFIELD_H
diff --git a/extern/caelum/include/PrecipitationController.h b/extern/caelum/include/PrecipitationController.h
deleted file mode 100644
index 00b699b8a0..0000000000
--- a/extern/caelum/include/PrecipitationController.h
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__PRECIPITATION_CONTROLLER_H
-#define CAELUM__PRECIPITATION_CONTROLLER_H
-
-#include "CaelumPrerequisites.h"
-#include "FastGpuParamRef.h"
-
-namespace Caelum
-{
-    /** Preset parameters for a certain type of precipitation.
-     */
-	struct PrecipitationPresetParams
-	{
-		Ogre::ColourValue Colour;
-        Ogre::Real Speed;
-		Ogre::String Name;
-	};
-
-    /** An enumeration of the available precipitation presets.
-     *  @see PrecipitationController::getPrecipitationPreset
-     */
-	enum PrecipitationType
-	{
-		PRECTYPE_DRIZZLE		= 0,
-		PRECTYPE_RAIN			= 1,
-		PRECTYPE_SNOW			= 2,
-		PRECTYPE_SNOWGRAINS	    = 3,
-		PRECTYPE_ICECRYSTALS	= 4,
-		PRECTYPE_ICEPELLETS	    = 5,
-		PRECTYPE_HAIL			= 6,
-		PRECTYPE_SMALLHAIL		= 7,
-
-		PRECTYPE_CUSTOM		    = 8,
-	};
-
-    /** Compositor-based precipitation controller.
-     *  This class will add and control precipitation controllers to viewports.
-     *
-     *  Compositors clone the composing materials. This controller will
-     *  register itself as a compositor listener and change the material in notifyMaterialSetup.
-     */
-	class CAELUM_EXPORT PrecipitationController
-	{
-	private:
-        friend class PrecipitationInstance;
-
-		Ogre::SceneManager *mSceneMgr;
-		Ogre::Vector3 mWindSpeed;
-		Ogre::Real mIntensity;
-		Ogre::Real mSpeed;
-		Ogre::ColourValue mColour;
-		PrecipitationType mPresetType;
-		Ogre::String mTextureName;
-        Ogre::Vector3 mCameraSpeedScale;
-        Ogre::Vector3 mFallingDirection;
-
-        Ogre::Real mAutoDisableThreshold;
-        bool mHardDisableCompositor;
-
-		Ogre::ColourValue mSceneColour;
-		Real mInternalTime;
-
-        // Only meant for the instance ctl in auto-camera-speed mode.
-        Real mSecondsSinceLastFrame;
-        inline Real getSecondsSinceLastFrame() { return mSecondsSinceLastFrame; }
-
-	public:
-        /// Name of the compositor resource.
-        static const String COMPOSITOR_NAME;
-
-        /// Name of the compositor material.
-        static const String MATERIAL_NAME;
-
-        /// Check if a preset type is valid.
-		static bool isPresetType (PrecipitationType value);
-
-        /// Get preset parameters for a certain type of precipitation.
-		static const PrecipitationPresetParams& getPresetParams (PrecipitationType value);
-
-        /// Set all parameters at once.
-		void setParams (const PrecipitationPresetParams& params);
-
-		/// Quickly set a certain preset type of precipitation.
-        void setPresetType (PrecipitationType value);
-
-        /** Get the preset type.
-         *  Will return PRECIPITATION_CUSTOM if you modify parameters manually
-         *  after setPresetType.
-         */
-        PrecipitationType getPresetType () const;
-
-		// Texture name, part of a preset
-		void setTextureName(const Ogre::String& textureName);
-		const Ogre::String getTextureName() const;
-
-		/// Precipitation color. Part of a preset
-		void setColour(const Ogre::ColourValue& color);
-		const Ogre::ColourValue getColour() const;
-
-		/// Precipitation speed (affects direction). Part of a preset
-		void setSpeed(Real value);
-		Real getSpeed() const;
-
-		/// Precipitation intensity.
-		void setIntensity(Real value);
-		Real getIntensity() const;
-
-		/// Wind speed and direction
-		void setWindSpeed(const Ogre::Vector3 &value);
-		const Ogre::Vector3 getWindSpeed() const;
-
-        /** The basic direction for falling precipitation.
-         *
-         *  This property define the notion of a "falling down" direction.
-         *  By default this is Vector3::NEGATIVE_UNIT_Y. You need to change
-         *  this for a Z-up system.
-         */
-        void setFallingDirection(const Ogre::Vector3 &value) { mFallingDirection = value; }
-		const Ogre::Vector3 getFallingDirection() const { return mFallingDirection; }
-
-		/// Set manual camera speed for all viewports.
-		void setManualCameraSpeed(const Ogre::Vector3 &value);
-
-        /// Set auto camera speed everywhere.o
-		void setAutoCameraSpeed();
-
-        /** Automatically disable compositors when intensity is low.
-         *  A negative value always enable the compositor.
-         *  @note: Ogre::CompositorInstance allocates/frees resources when
-         *         enabling or disabling. That is expensive.
-         */
-        inline void setAutoDisableThreshold (Real value) { mAutoDisableThreshold = value; }
-        inline Real getAutoDisableThreshold () const { return mAutoDisableThreshold; }
-
-        /** Automatically scale camera speed.
-         *
-         *  This is multiplied per-component with camera speed; manual or
-         *  automatic. It's most useful for automatic camera speed to control 
-         *  how much of an effect moving the camera has on rain drop directions.
-         *
-         *  The components should probably be equal.
-         *
-         *  Default in Ogre::Vector3::UNIT_SCALE
-         */
-        inline void setCameraSpeedScale (const Ogre::Vector3& value) {
-            mCameraSpeedScale = value;
-        }
-        inline const Ogre::Vector3 getCameraSpeedScale () const {
-            return mCameraSpeedScale;
-        }
-
-        /** Set an equal camera speed scale in all dimensions.
-         */
-        inline void setCameraSpeedScale (Ogre::Real value) {
-            setCameraSpeedScale(Ogre::Vector3::UNIT_SCALE * value);
-        }
-
-        /** Update the the precipitation controller.
-         *  @param secondsSinceLastFrame Number of secods since the last frame.
-         */
-		void update(Real secondsSinceLastFrame, Ogre::ColourValue colour);
-
-		PrecipitationController(
-				Ogre::SceneManager *sceneMgr);
-		~PrecipitationController();
-
-    public:
-        typedef std::map<Ogre::Viewport*, PrecipitationInstance*> ViewportInstanceMap;
-        ViewportInstanceMap mViewportInstanceMap;
-
-    public:
-        /// Add precipitation to a certain viewport.
-        PrecipitationInstance* createViewportInstance(Ogre::Viewport* viewport);
-
-        /// Remove precipitation from a certain viewport.
-        void destroyViewportInstance(Ogre::Viewport* viewport);
-
-        /// Get per-viewport instance, or null if not created yet.
-        PrecipitationInstance* getViewportInstance(Ogre::Viewport* viewport);
-
-        /// Remove from all attached viewports; clean up.
-        void destroyAllViewportInstances();
-	};
-
-    /** Per-viewport instance of precipitation.
-     *  This will create and control an ogre::CompositorInstance.
-     */
-    class PrecipitationInstance: private Ogre::CompositorInstance::Listener
-    {
-    private:
-        friend class PrecipitationController;
-
-        PrecipitationController* mParent;
-        Ogre::Viewport* mViewport;
-        Ogre::CompositorInstance* mCompInst;
-        Ogre::Camera* mLastCamera;
-        Ogre::Vector3 mLastCameraPosition;
-        Ogre::Vector3 mCameraSpeed;
-		bool mAutoCameraSpeed;
-
-        virtual void notifyMaterialSetup(uint pass_id, Ogre::MaterialPtr &mat);
-        virtual void notifyMaterialRender(uint pass_id, Ogre::MaterialPtr &mat);
-
-        /// Called to enforce parameters on a composing material
-        /// Called from notifyMaterialRender.
-    	void _updateMaterialParams(
-                const Ogre::MaterialPtr& mat,
-                const Ogre::Camera* cam,
-                const Ogre::Vector3& camSpeed);
-
-        // Add remove the compositors. Do nothing if already added/removed
-        void createCompositor ();
-        void destroyCompositor ();
-
-        // Check if the compositor should be enabled
-        bool shouldBeEnabled () const;
-
-        /// Called from the parent's update.
-        void _update();
-
-    public:
-        inline Ogre::Viewport* getViewport() const { return mViewport; }
-        inline PrecipitationController* getParent() const { return mParent; }
-        inline Ogre::CompositorInstance* getCompositorInstance() const { return mCompInst; }
-
-        /// Check if camera speed is automatically calculated (default true).
-        bool getAutoCameraSpeed();
-
-        /** Set camera speed to automatic calculation.
-         *
-         *  @warning: This runs into difficult precission issues. It is
-         *  better to use setManualCameraSpeed.
-         */
-        void setAutoCameraSpeed();
-
-        /// Set manual camera speed; disables automatic calculation.
-        void setManualCameraSpeed(const Ogre::Vector3& value);
-
-        /// Get current camera speed. Doesn't include CameraSpeedScale.
-        const Ogre::Vector3 getCameraSpeed();
-
-        PrecipitationInstance(PrecipitationController* parent, Ogre::Viewport* view);
-        virtual ~PrecipitationInstance();
-
-    private:
-        struct Params {
-            void setup(Ogre::GpuProgramParametersSharedPtr fpParams);
-
-            Ogre::GpuProgramParametersSharedPtr fpParams;
-            FastGpuParamRef precColor;
-            FastGpuParamRef intensity;
-            FastGpuParamRef dropSpeed;
-            FastGpuParamRef corner1;
-            FastGpuParamRef corner2;
-            FastGpuParamRef corner3;
-            FastGpuParamRef corner4;
-            FastGpuParamRef deltaX;
-            FastGpuParamRef deltaY;
-        } mParams;
-
-    };
-}
-
-#endif //CAELUM__PRECIPITATION_CONTROLLER_H
diff --git a/extern/caelum/include/PrivatePtr.h b/extern/caelum/include/PrivatePtr.h
deleted file mode 100644
index 3bb08a3644..0000000000
--- a/extern/caelum/include/PrivatePtr.h
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__PRIVATE_PTR_H
-#define CAELUM__PRIVATE_PTR_H
-
-#include "CaelumPrerequisites.h"
-
-namespace Caelum
-{
-    /** Default traits for Caelum::PrivatePtr.
-     *
-     *  This default traits class make PrivatePtr work like std::auto_ptr.
-     *  Other Traits classes can derive from this and only customize some of
-     *  the functions.
-     *
-     *  @see PrivatePtr
-     */
-    template<class PointedT>
-    struct DefaultPrivatePtrTraits
-    {
-        /// The type of the inner member to hold in PrivatePtr
-        typedef PointedT* InnerPointerType;
-
-        /// Return an InnerPointerType repressenting a null value.
-        static inline const InnerPointerType getNullValue() {
-            return 0;
-        }
-
-        /// Convert InnerPointerType to a naked PointedT.
-        static inline PointedT* getPointer (const InnerPointerType& inner) {
-            return inner;
-        }
-
-        /// Destroy the inner value (and set null).
-        static void destroy (InnerPointerType& inner)
-        {
-            delete inner;
-            inner = 0;
-        }
-    };
-
-    /** Template for smart pointers with strict unique ownership.
-     *  A lot of objects in Ogre are created and destroyed through other
-     *  "Manager" objects. Even though the memory for such objects is never
-     *  actually leaked better lifetime control is frequently useful.
-     *
-     *  PrivatePtr is very similar in behaviour to std::auto_ptr but tries
-     *  to mimic Ogre::SharedPtr method names. Only one PrivatePtr must exist to
-     *  a certain object at any one time. Assignment and copy  construction will
-     *  in fact pass away ownership and set the original PrivatePtr to null.
-     *
-     *  This very limited functionality makes PrivatePtr very efficient; it should
-     *  have no overhead compared to doing the same thing manually.
-     *
-     *  PrivatePtr supports customization through a static traits class which
-     *  can customize what happens when the PrivatePtr is destroyed. This makes
-     *  it possible to use PrivatePtr classes for fine control over the lifetime
-     *  of objects which are otherwise managed by an external class.
-     *
-     *  @see DefaultPrivatePtrTraits
-     */
-    template<class PointedT, typename TraitsT = DefaultPrivatePtrTraits<PointedT> >
-    class PrivatePtr
-    {
-    private:
-        /// Brings InnerPointerType as a type in this scope.
-        typedef typename TraitsT::InnerPointerType InnerPointerType;
-
-        /// Inner data member.
-        InnerPointerType mInner;
-
-	public:
-        /** Change the inner value.
-         *  This will destroy the old value and gain ownership of the new value.
-         */
-        void reset (const InnerPointerType& newInner = TraitsT::getNullValue()) {
-            if (mInner == newInner) {
-                return;
-            }
-            TraitsT::destroy (mInner);
-            mInner = newInner;
-        }
-
-        InnerPointerType release () {
-            InnerPointerType result = mInner;
-            mInner = TraitsT::getNullValue();
-            return result;
-        }
-
-        /** Constructor; always initialize to 0.
-         */
-        PrivatePtr () { mInner = TraitsT::getNullValue (); }
-
-        /** Initializing constructur
-         */
-        PrivatePtr (const InnerPointerType& inner) { mInner = inner; }
-
-        /** Non-virtual destructor (don't derive from this).
-         */
-        ~PrivatePtr () { setNull(); }
-
-        /** Copy constructor; clears right-hand-side.
-         */
-        PrivatePtr (PrivatePtr& rhs)
-        {
-            if (&rhs != this) {
-                this->reset (rhs.mInner);
-                rhs.mInner = TraitsT::getNullValue ();
-            }
-        }
-        
-        /** Assignment
-         */
-        const PrivatePtr& operator= (PrivatePtr& rhs)
-        {
-            if (&rhs != this) {
-                this->reset (rhs.mInner);
-                rhs.mInner = TraitsT::getNullValue ();
-            }
-            return *this;
-        }
-
-        /// Check if this is null.
-        bool isNull () const { return mInner == TraitsT::getNullValue (); }
-
-        /// Set to null and destroy contents (if any).
-        void setNull () {
-            TraitsT::destroy (mInner);
-            assert(this->isNull());
-        }
-
-        PointedT* getPointer () const { return TraitsT::getPointer (mInner); }
-        PointedT* get () const { return getPointer (); }
-        PointedT* operator-> () const { return getPointer (); }
-        PointedT& operator* () const{ return *getPointer (); }
-    };
-
-    /** PrivatePtr traits for a movable object.
-     *  This kind of pointer will remove the movable from the scene and destroy it.
-     */
-    template<class MovableT>
-    struct MovableObjectPrivatePtrTraits: public DefaultPrivatePtrTraits<MovableT>
-    {
-        typedef MovableT* InnerPointerType;
-
-        static void destroy (InnerPointerType& inner)
-        {
-            if (inner != 0) {
-                //Ogre::LogManager::getSingletonPtr ()->logMessage (
-                //        "PrivatePtr: Destroying movable object " + inner->getName ());
-                inner->_getManager ()->destroyMovableObject (inner);
-                inner = 0;
-            }
-        }
-    };
-
-    typedef PrivatePtr<Ogre::MovableObject, MovableObjectPrivatePtrTraits<Ogre::MovableObject> > PrivateMovableObjectPtr;
-    typedef PrivatePtr<Ogre::BillboardChain, MovableObjectPrivatePtrTraits<Ogre::BillboardChain> > PrivateBillboardChainPtr;
-    typedef PrivatePtr<Ogre::BillboardSet, MovableObjectPrivatePtrTraits<Ogre::BillboardSet> > PrivateBillboardSetPtr;
-    typedef PrivatePtr<Ogre::Entity, MovableObjectPrivatePtrTraits<Ogre::Entity> > PrivateEntityPtr;
-    typedef PrivatePtr<Ogre::Light, MovableObjectPrivatePtrTraits<Ogre::Light> > PrivateLightPtr;
-    typedef PrivatePtr<Ogre::ManualObject, MovableObjectPrivatePtrTraits<Ogre::ManualObject> > PrivateManualObjectPtr;
-    typedef PrivatePtr<Ogre::ParticleSystem, MovableObjectPrivatePtrTraits<Ogre::ParticleSystem> > PrivateParticleSystemPtr;
-
-    /** PrivatePtr traits for a scene node.
-     *  Scene nodes are created and destroyed through the scene manager.
-     *  @see PrivatePrivateSceneNodePtr
-     */
-    struct SceneNodePrivatePtrTraits: public DefaultPrivatePtrTraits<Ogre::SceneNode>
-    {
-        static void destroy (InnerPointerType& inner)
-        {
-            if (inner) {
-                //Ogre::LogManager::getSingletonPtr ()->logMessage (
-                //        "PrivatePtr: Destroying scene node " + inner->getName ());
-                inner->getCreator ()->destroySceneNode (inner->getName ());
-                inner = 0;
-            }
-        }
-    };
-
-    typedef PrivatePtr<Ogre::SceneNode, SceneNodePrivatePtrTraits> PrivateSceneNodePtr;
-
-    /** PrivatePtr traits for uniquely-owned resources.
-     *
-     *  All ogre resources are tracked by a resource managed by name and can
-     *  be globally referenced from multiple places. This traits class allows
-     *  you to hold a pointer to a resource which you create and completely
-     *  control.
-     *
-     *  The best example of this is a cloned material. It is frequently useful
-     *  to create a clone of an existing material and tweak settings for one
-     *  particular usage. After the clone is no longer useful the material must
-     *  be explicitly removed from the MaterialManager. Otherwise an unloaded
-     *  resource handle is leaked.
-     *
-     *  When the PrivatePtr gets out of scope the resource is removed from the
-     *  manager. In debug mode this will also check that there are no other
-     *  references to the destroyed resource.
-     */
-    template<class PointedT, class InnerT, class ManagerT>
-    struct PrivateResourcePtrTraits
-    {
-        typedef InnerT InnerPointerType;
-
-        static const InnerT getNullValue () {
-            return InnerT();
-        }
-
-        static PointedT* getPointer (const InnerPointerType& inner) {
-            return inner.getPointer ();
-        }
-
-        static void destroy (InnerPointerType& inner) {
-            if (!inner.isNull ()) {
-                //Ogre::LogManager::getSingletonPtr ()->logMessage (
-                //        "PrivateResourcePtrTraits: Destroying owned resource"
-                //        " name=" + inner->getName () +
-                //        " handle=" + Ogre::StringConverter::toString (inner->getHandle ()) );
-                ManagerT::getSingletonPtr ()->remove (inner->getHandle ());
-                assert (inner.unique () && "Resource pointer not unique after destruction");
-                inner.setNull();
-            }
-        }
-    };
-
-    typedef PrivatePtr <
-        Ogre::Material,
-        PrivateResourcePtrTraits <
-            Ogre::Material,
-            Ogre::MaterialPtr,
-            Ogre::MaterialManager
-        >
-    > PrivateMaterialPtr;
-
-    typedef PrivatePtr <
-        Ogre::Mesh,
-        PrivateResourcePtrTraits <
-            Ogre::Mesh,
-            Ogre::MeshPtr,
-            Ogre::MeshManager
-        >
-    > PrivateMeshPtr;
-}
-
-#endif // CAELUM__PRIVATE_PTR_H
diff --git a/extern/caelum/include/SkyDome.h b/extern/caelum/include/SkyDome.h
deleted file mode 100644
index 884a3e2774..0000000000
--- a/extern/caelum/include/SkyDome.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__SKYDOME_H
-#define CAELUM__SKYDOME_H
-
-#include "CaelumPrerequisites.h"
-#include "CameraBoundElement.h"
-#include "FastGpuParamRef.h"
-#include "PrivatePtr.h"
-
-namespace Caelum
-{
-    /** A sky dome element.
-     */
-    class CAELUM_EXPORT SkyDome : public CameraBoundElement
-    {
-	private:
-		/** Name of the spheric dome resource.
-		 */
-		static const Ogre::String SPHERIC_DOME_NAME;
-
-		/** Name of the dome material.
-		 */
-		static const Ogre::String SKY_DOME_MATERIAL_NAME;
-
-		/// Control scene node.
-		PrivateSceneNodePtr mNode;
-
-		/// Sky dome material.
-		PrivateMaterialPtr mMaterial;
-
-        /// Sky dome entity.
-        PrivateEntityPtr mEntity;
-
-    private:
-		/// True if selected technique has shaders.
-		bool mShadersEnabled;
-
-        /// If haze is enabled.
-		bool mHazeEnabled;
-
-	public:
-		/** Constructor
-         *  This will setup some nice defaults.
-		 *  @param sceneMgr The scene manager where this sky dome will be created.
-		 */
-		SkyDome (Ogre::SceneManager *sceneMgr, Ogre::SceneNode *caelumRootNode);
-
-		/** Destructor
-		 */
-		virtual ~SkyDome ();
-
-		/** Sets the sun direction.
-			@param dir The sun light direction.
-		 */
-		void setSunDirection (const Ogre::Vector3& dir);
-
-        /// Explicit haze colour.
-        void setHazeColour (const Ogre::ColourValue& hazeColour);
-
-        /// Set the sky color gradients image.
-        void setSkyGradientsImage (const Ogre::String& gradients);
-
-        /// Set the atmosphere depthh gradient image.
-        void setAtmosphereDepthImage (const Ogre::String& gradients);
-
-        /** Enable or disable skydome haze. This makes the sky darker.
-         *  By default haze is disabled.
-         */
-        void setHazeEnabled (bool value);
-
-        /// If skydome haze is enabled.
-        bool getHazeEnabled () const;
-
-        void setQueryFlags (uint flags) { mEntity->setQueryFlags (flags); }
-        uint getQueryFlags () const { return mEntity->getQueryFlags (); }
-        void setVisibilityFlags (uint flags) { mEntity->setVisibilityFlags (flags); }
-        uint getVisibilityFlags () const { return mEntity->getVisibilityFlags (); }
-
-    public:
-		/// Handle camera change.
-		virtual void notifyCameraChanged (Ogre::Camera *cam);
-
-    protected:
-        /// Handle far radius.
-	    virtual void setFarRadius (Ogre::Real radius);
-
-    private:
-        struct Params {
-            void setup(Ogre::GpuProgramParametersSharedPtr vpParams, Ogre::GpuProgramParametersSharedPtr fpParams);
-
-            Ogre::GpuProgramParametersSharedPtr vpParams;
-            Ogre::GpuProgramParametersSharedPtr fpParams;
-            FastGpuParamRef sunDirection;
-            FastGpuParamRef offset;
-            FastGpuParamRef hazeColour;
-        } mParams;
-    };
-}
-
-#endif //CAELUM__SKYDOME_H
diff --git a/extern/caelum/include/SkyLight.h b/extern/caelum/include/SkyLight.h
deleted file mode 100644
index 95eeea1cc6..0000000000
--- a/extern/caelum/include/SkyLight.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__SKYLIGHT_H
-#define CAELUM__SKYLIGHT_H
-
-#include "CameraBoundElement.h"
-
-namespace Caelum
-{
-    /** Base class for sky lights (sun and moon).
-     *  Contains a directional light which can be automatically disabled when too dim.
-     */
-    class CAELUM_EXPORT BaseSkyLight : public CameraBoundElement
-    {
-	protected:
-		/// The main directional light.
-		Ogre::Light *mMainLight;
-
-		/// The sun scene node.
-		Ogre::SceneNode *mNode;
-
-		/// Base distance of the light.
-		float mRadius;
-
-		/// The latest normalised sun direction.
-		Ogre::Vector3 mDirection;
-		
-		/// Body sphere colour, as set by setBodyColour
-		Ogre::ColourValue mBodyColour;
-
-		/// Sun light colour, as set by setLightColour
-		Ogre::ColourValue mLightColour;
-
-		/// Colour multiplier for light diffuse colour.
-		Ogre::ColourValue mDiffuseMultiplier;
-
-		/// Colour multiplier for light specular colour.
-		Ogre::ColourValue mSpecularMultiplier;
-
-		/** Colour multiplier for ambient light colour.
-		 *  No effect, this value is only stored here.
-		 */
-		Ogre::ColourValue mAmbientMultiplier;
-
-        /// If the light is automatically disabled beneath mAutoDisableThreshold
-        bool mAutoDisableLight;
-
-        /// Threshold beneath which the light is automatically disabled.
-        Ogre::Real mAutoDisableThreshold;
-
-        /// If the light is always disabled. Separate from the mAutoDisable mechanism.
-        bool mForceDisableLight;
-
-	public:
-		/** Constructor.
-			@param sceneMgr The scene manager where the lights will be created.
-            @param caelumRootNode Root node to attach to. Should be bound to the camera.
-		 */
-		BaseSkyLight (
-                Ogre::SceneManager *sceneMgr,
-                Ogre::SceneNode *caelumRootNode);
-
-		/// Destructor.
-		virtual ~BaseSkyLight () = 0;
-
-		/** Updates skylight parameters.
-		 *  @param direction Light direction.
-		 *  @param lightColour Color for the light source
-		 *  @param bodyColour Color to draw the body of the light (whatever that is).
-		 */
-        virtual void update (
-                const Ogre::Vector3& direction,
-                const Ogre::ColourValue &lightColour,
-                const Ogre::ColourValue &bodyColour);
-
-		/// Retrieves the latest light direction.
-		const Ogre::Vector3 getLightDirection () const;
-
-		/// Set the sun direction.
-		virtual void setLightDirection (const Ogre::Vector3 &dir);
-
-		/// Get current body colour, as set in setBodyColour.
-		const Ogre::ColourValue getBodyColour () const;
-
-		/// Sets the colour to draw the light's body with.
-		virtual void setBodyColour (const Ogre::ColourValue &colour);
-
-		/// Get current light colour, as set in setLightColour.
-		const Ogre::ColourValue getLightColour () const;
-
-		/// Sets the skylight colour.
-		virtual void setLightColour (const Ogre::ColourValue &colour);
-
-		/// Set diffuse multiplier for light colour
-		void setDiffuseMultiplier (const Ogre::ColourValue &diffuse);
-
-		/// Set diffuse multiplier for light colour
-		const Ogre::ColourValue getDiffuseMultiplier () const;
-
-		/// Set specular multiplier for light colour
-		void setSpecularMultiplier (const Ogre::ColourValue &specular);
-
-		/// Set specular multiplier for light colour
-		const Ogre::ColourValue getSpecularMultiplier () const;
-
-		/// Set ambient multiplier for light colour
-		/// This value is only stored here; the SceneManager is not touched
-        /// However, CaelumSystem does use this value.
-		void setAmbientMultiplier (const Ogre::ColourValue &ambient);
-
-		/// Set ambient multiplier for light colour
-		const Ogre::ColourValue getAmbientMultiplier () const;
-
-		/// Direct access to the Ogre::Light.
-		Ogre::Light* getMainLight() const;
-
-        /// Check if the light is automatically disabled.
-        inline bool getAutoDisable() const { return mAutoDisableLight; }
-
-        /** Turn on and off auto-disabling of the light when too dim.
-         *  This is off by default. If you set it to true you probably also want to
-         *  set the autoDisableThreshold.
-         *  The "intensity" of the light for the threshold is calculated as the plain sum of r, g and b.
-         */
-        inline void setAutoDisable(bool value) { mAutoDisableLight = value; }
-
-        /// Get the auto-disable threshold.
-        inline Ogre::Real getAutoDisableThreshold() const { return mAutoDisableThreshold; }
-
-        /// Set the auto-disable threshold.
-        inline void setAutoDisableThreshold(Ogre::Real value) { mAutoDisableThreshold = value; }
-
-        static const Ogre::Real DEFAULT_AUTO_DISABLE_THRESHOLD;
-
-        /// Disable the light by force; without taking intensity into account.
-        inline void setForceDisable(bool value) { mForceDisableLight = value; } 
-        inline bool getForceDisable() const { return mForceDisableLight; }
-
-        virtual void setQueryFlags (uint flags) = 0;
-        virtual uint getQueryFlags () const = 0;
-        virtual void setVisibilityFlags (uint flags) = 0;
-        virtual uint getVisibilityFlags () const = 0;
-
-    protected:
-        /// Handle far radius.
-	    virtual void setFarRadius (Ogre::Real radius);
-		
-		/// Temporary change main light color
-		void setMainLightColour(const Ogre::ColourValue &colour);
-
-        /// If the light should be enabled for a certain value.
-        /// This functions takes AutoDisable and such into account.
-        bool shouldEnableLight(const Ogre::ColourValue &colour);
-    };
-}
-
-#endif // CAELUM__SKYLIGHT_H
diff --git a/extern/caelum/include/Sun.h b/extern/caelum/include/Sun.h
deleted file mode 100644
index 67c3b41216..0000000000
--- a/extern/caelum/include/Sun.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__SUN_H
-#define CAELUM__SUN_H
-
-#include "CaelumPrerequisites.h"
-#include "CameraBoundElement.h"
-#include "SkyLight.h"
-#include "PrivatePtr.h"
-
-namespace Caelum
-{
-    class BaseSkyLight;
-    class SphereSun;
-    class SpriteSun;
-
-    typedef SpriteSun Sun;
-
-    /** Class representing the sun as sphere with emissive color on it.
-     *  @deprecated
-     */
-    class CAELUM_EXPORT SphereSun : public BaseSkyLight
-    {
-	public:
-		/// Name of the sun material.
-		static const Ogre::String SUN_MATERIAL_NAME;
-
-	private:
-		/// Reference to the sun material.
-		PrivateMaterialPtr mSunMaterial;
-
-		/// The sun entity.
-		PrivateEntityPtr mSunEntity;
-
-	public:
-		/** Constructor.
-			@param sceneMgr The scene manager where the lights will be created.
-		 */
-		SphereSun (
-                Ogre::SceneManager *sceneMgr,
-                Ogre::SceneNode *caelumRootNode,
-                const Ogre::String &meshName = "sphere.mesh");
-
-		/** Destructor.
-			@note If a sun position model is in use, it will be deleted.
-		 */
-		virtual ~SphereSun ();
-
-		/** Sets the sun sphere colour.
-			@param colour The colour used to draw the sun
-		 */
-		void setBodyColour (const Ogre::ColourValue &colour);
-
-    public:
-		/// Handle camera change.
-		virtual void notifyCameraChanged (Ogre::Camera *cam);
-
-        virtual void setQueryFlags (uint flags) { mSunEntity->setQueryFlags (flags); }
-        virtual uint getQueryFlags () const { return mSunEntity->getQueryFlags (); }
-        virtual void setVisibilityFlags (uint flags) { mSunEntity->setVisibilityFlags (flags); }
-        virtual uint getVisibilityFlags () const { return mSunEntity->getVisibilityFlags (); }
-    };
-
-    /** Class representing the sun as billboard with texture on it.
-     */
-    class CAELUM_EXPORT SpriteSun : public BaseSkyLight
-    {
-	public:
-		/// Name of the sun material.
-		static const Ogre::String SUN_MATERIAL_NAME;
-
-	protected:
-		/// The sun material.
-		PrivateMaterialPtr mSunMaterial;
-
-		/// The sun sprite / billboard
-		PrivateBillboardSetPtr mSunBillboardSet;
-		
-		/// The sun sprite visible angle
-		Ogre::Degree mSunTextureAngularSize;
-
-	public:
-		/** Constructor.
-			@param sceneMgr The scene manager where the lights will be created.
-            @param sunTextureAngularSize 0.53f is real angular size of Sun and Moon, 3.77f is compatible with SphereSun
-		 */
-		SpriteSun (
-                Ogre::SceneManager *sceneMgr,
-                Ogre::SceneNode *caelumRootNode,
-                const Ogre::String& sunTextureName = "sun_disc.png", 
-                const Ogre::Degree& sunTextureAngularSize = Ogre::Degree(3.77f));
-
-		/** Destructor.
-			@note If a sun position model is in use, it will be deleted.
-		 */
-		virtual ~SpriteSun ();
-
-		/** Updates the sun material.
-			@param textureName The new sun texture name.
-		 */
-		void setSunTexture (const Ogre::String &textureName);
-		
-		/** Updates the sun size.
-			@param sunTextureAngularSize The new sun texture angular size.
-		 */
-		void setSunTextureAngularSize(const Ogre::Degree& sunTextureAngularSize);
-
-		/** Sets the sun sphere colour.
-			@param colour The colour used to draw the sun
-		 */
-		void setBodyColour (const Ogre::ColourValue &colour);
-
-    public:
-		/// Handle camera change.
-		virtual void notifyCameraChanged (Ogre::Camera *cam);
-
-        virtual void setQueryFlags (uint flags) { mSunBillboardSet->setQueryFlags (flags); }
-        virtual uint getQueryFlags () const { return mSunBillboardSet->getQueryFlags (); }
-        virtual void setVisibilityFlags (uint flags) { mSunBillboardSet->setVisibilityFlags (flags); }
-        virtual uint getVisibilityFlags () const { return mSunBillboardSet->getVisibilityFlags (); }
-    };
-}
-
-#endif // CAELUM__SUN_H
diff --git a/extern/caelum/include/TypeDescriptor.h b/extern/caelum/include/TypeDescriptor.h
deleted file mode 100644
index ba642e33dd..0000000000
--- a/extern/caelum/include/TypeDescriptor.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef CAELUM__TYPE_DESCRIPTOR_H
-#define CAELUM__TYPE_DESCRIPTOR_H
-
-#include "CaelumPrerequisites.h"
-
-#if CAELUM_TYPE_DESCRIPTORS
-
-#include <typeinfo>
-
-namespace Caelum
-{
-    class ValuePropertyDescriptor;
-
-    /** Abstract interface for a type descriptor.
-     *  A type descriptor contains informations about the properties of
-     *  another object. It provides access to a map of strings to
-     *  ValuePropertyDescriptor. All methods are const.
-     * 
-     *  This is not a full reflection mechanism; it doesn't care about
-     *  methods and parameters. It's just a way to access object properties
-     *  in a uniform way.
-     *
-     *  The list of properties supported by a type descriptor is fixed.
-     *
-     *  The type descriptor is responsible for the lifetime of
-     *  ValuePropertyDescriptor objects; never the user.
-     */
-    class CAELUM_EXPORT TypeDescriptor
-    {
-    public:
-        virtual ~TypeDescriptor() {};
-
-        typedef std::map<String, const ValuePropertyDescriptor*> PropertyMap;
-
-        /** Get a property descriptor; or null if not available.
-         *  @param name Name of the property to request.
-         *  @return A pointer to a property descriptor; or null if not available.
-         */
-        virtual const ValuePropertyDescriptor* getPropertyDescriptor (const Ogre::String& name) const = 0;
-
-        /** Get a map of all supported properties.
-         *  Returns a complete list of all supported properties; by value.
-         */
-        virtual const std::vector<String> getPropertyNames () const = 0;
-
-        /** Get a map of all supported properties.
-         *  Returns a complete list of all supported properties; by value.
-         */
-        virtual const PropertyMap getFullPropertyMap () const = 0;
-    };
-
-    /** Basic property descriptor interface.
-     *
-     *  A property descriptor provides a uniform way to change the value of a
-     *  simple property. The values are safely wrapped inside an Ogre::Any.
-     *
-     *  This only works for simple properties which are copied by value. This
-     *  includes floats strings and vectors but not things like Entity pointers.
-     *
-     *  All public methods are const because the descriptor itself is not
-     *  modified by these methods.
-     */
-    class CAELUM_EXPORT ValuePropertyDescriptor
-    {
-    public:
-        virtual ~ValuePropertyDescriptor() {};
-
-        /** If the value of the property can be read (true means write-only).
-         *
-         *  This is false for write-only properties.
-         *  Write-only properties are generally a bad idea but they are supported.
-         *  Scripting (with .os files) doesn't actually require reading existing values.
-         */
-        virtual bool canGetValue () const = 0;
-
-        /// If the value of the property can be set (false means read-only).
-        virtual bool canSetValue () const = 0;
-
-        /** Get the value of the property packed in an Ogre::Any.
-         *  
-         *  @param target Object to fetch the property from. If target is
-         *  not of the correct type behaviour is undefined.
-         */
-        virtual const Ogre::Any getValue (const void* target) const = 0;
-
-        /** Set the value of the property packed in an Ogre::Any.
-         *  @param target Object set the property on. If target is not of
-         *  the correct type then behaviour is undefined.
-         *  @param value New value of the property.
-         */
-        virtual void setValue (void* target, const Ogre::Any& value) const = 0;
-
-        /// Get std::type_info for the type of the value.
-        virtual const std::type_info& getValueTypeId () const = 0;
-
-        /** Check if this class also implements TypedValuePropertyDescriptor.
-         *
-         *  If this property returns true then you can static_cast this object to
-         *  a TypedValuePropertyDescriptor<ValueT>; for the appropiate ValueT.
-         *  The appropriate ValueT can be obtained with getValueTypeId.
-         */
-        virtual bool implementsTypedValuePropertyDescriptor () const {
-            return false;
-        }
-    };
-
-    /** Variant of ValuePropertyDescriptor which allows faster typed get/set methods.
-     */
-    template<typename ValueT>
-    class CAELUM_EXPORT TypedValuePropertyDescriptor: public ValuePropertyDescriptor
-    {
-    public:
-        /// Get the property's value.
-        virtual const ValueT getValueTyped (const void* target) const = 0;
-        /// Set the property's value.
-        virtual void setValueTyped (void* target, const ValueT& value) const = 0;
-
-    private:
-        virtual const Ogre::Any getValue (const void* target) const {
-            return Ogre::Any(this->getValueTyped (target));
-        }
-
-        virtual void setValue (void* target, const Ogre::Any& value) const {
-            this->setValueTyped (target, Ogre::any_cast<ValueT>(value));
-        }
-
-        virtual const std::type_info& getValueTypeId () const {
-            return typeid(ValueT);
-        }
-
-        virtual bool implementsTypedValuePropertyDescriptor () const {
-            return true;
-        }
-    };
-
-    /** ValuePropertyDescriptor implementation based on function pointers to get/set methods.
-     */
-    template <class TargetT, typename ParamT, typename InParamT = const ParamT&, typename OutParamT = const ParamT>
-    class AccesorPropertyDescriptor: public TypedValuePropertyDescriptor<ParamT>
-    {
-    public:
-        typedef void(TargetT::*SetFunc)(InParamT);
-        typedef OutParamT(TargetT::*GetFunc)(void) const;
-
-    private:
-        GetFunc mGetFunc;
-        SetFunc mSetFunc;
-
-    public:
-        AccesorPropertyDescriptor (GetFunc getFunc, SetFunc setFunc)
-        {
-            mGetFunc = getFunc;
-            mSetFunc = setFunc;
-        }
-
-        virtual bool canGetValue () const {
-            return mGetFunc != 0;
-        }
-
-        virtual bool canSetValue () const {
-            return mSetFunc != 0;
-        }
-
-        virtual const ParamT getValueTyped(const void* target) const
-        {
-            const TargetT* typedTarget = reinterpret_cast<const TargetT*>(target);
-            return (typedTarget->*mGetFunc)();
-        }
-
-        virtual void setValueTyped(void* target, const ParamT& value) const
-        {
-            TargetT* typedTarget = reinterpret_cast<TargetT*>(target);
-            (typedTarget->*mSetFunc)(value);
-        }
-    };
-
-    /** Default implementation of a TypeDescriptor.
-     *  This is a standard implementation of a type descriptor.
-     *
-     *  It allows direct access to an internal PropertyMap. The user must
-     *  manually fill the map with property descriptors; probably in an init
-     *  method of sorts.
-     */
-    class DefaultTypeDescriptor: public TypeDescriptor 
-    {
-    public:
-        DefaultTypeDescriptor ();
-        virtual ~DefaultTypeDescriptor ();
-
-        /** Direct access to the internal property map.
-         *  Get the property map used to implement this type descriptor.
-         *  Once initialisation is complete the property map should no longer
-         *  be modified.
-         */
-        inline PropertyMap& getPropertyMap () { return mPropertyMap; }
-
-        /// Add a property. Type descriptor takes ownership.
-        void add (const Ogre::String& name, const ValuePropertyDescriptor* descriptor);
-
-        /// Clear the property map; delete all property descriptors.
-        void clear ();
-
-        /// @copydoc TypeDescriptor::getPropertyDescriptor
-        virtual const ValuePropertyDescriptor* getPropertyDescriptor (const Ogre::String& name) const;
-
-        /// @copydoc TypeDescriptor::getPropertyNames
-        virtual const std::vector<String> getPropertyNames () const;
-
-        /// @copydoc TypeDescriptor::getFullPropertyMap
-        virtual const PropertyMap getFullPropertyMap () const;
-
-    private:
-        void deleteAllPropertyDescriptors ();
-
-        PropertyMap mPropertyMap;
-    };
-
-    /** Standard type descriptors for caelum components.
-     *
-     *  This class hold pointers to several type descriptors for classes
-     *  inside Caelum. All the pointers are initialize in the contructor and
-     *  properly destroyed in the destructor.
-     *
-     *  The CaelumPlugin singleton contains a const instance of this class. You
-     *  should fetch that instead of creating a new object; using
-     *  CaelumPlugin::getTypeDescriptorData().
-     */
-    class CAELUM_EXPORT CaelumDefaultTypeDescriptorData
-    {
-    private:
-        void load();
-        void unload();
-
-    public:
-        CaelumDefaultTypeDescriptorData();
-        ~CaelumDefaultTypeDescriptorData();
-
-        DefaultTypeDescriptor* CaelumSystemTypeDescriptor;
-        DefaultTypeDescriptor* PointStarfieldTypeDescriptor;
-        DefaultTypeDescriptor* BaseSkyLightTypeDescriptor;
-        DefaultTypeDescriptor* GroundFogTypeDescriptor;
-        DefaultTypeDescriptor* PrecipitationTypeDescriptor;
-        DefaultTypeDescriptor* DepthComposerTypeDescriptor;
-        DefaultTypeDescriptor* FlatCloudLayerTypeDescriptor;
-        DefaultTypeDescriptor* SkyDomeTypeDescriptor;
-    };
-}
-
-#endif // CAELUM_TYPE_DESCRIPTORS
-
-#endif // CAELUM__TYPE_DESCRIPTOR_H
diff --git a/extern/caelum/include/UniversalClock.h b/extern/caelum/include/UniversalClock.h
deleted file mode 100644
index 870df31725..0000000000
--- a/extern/caelum/include/UniversalClock.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef UNIVERSALCLOCK_H
-#define	UNIVERSALCLOCK_H
-
-#include "CaelumPrerequisites.h"
-
-namespace Caelum {
-
-    /** The system's time model.
-     *  This class is responsible of keeping track of current astronomical time
-     *  and syncronising with ogre time.
-     *
-     *  It maintains a snapshot point: At mCurrentTime == 0 julian day was mJulianDayBase.
-     *  At any time the julian day can be calculated from mCurrentTime and mJulianDayBase.
-     *  This increases precission; mCurrentTime is tracked in seconds while mJulianDayBase
-     *  uses days. It would be silly to track the current time in days.
-     */
-    class CAELUM_EXPORT UniversalClock
-    {
-	private:
-        /// Astronomical julian day at mCurrentTime = 0;
-		LongReal mJulianDayBase;
-
-        /// Seconds since mJulianDayBase.
-        LongReal mCurrentTime;
-
-		/// Seconds since mJulianDayBase at last update.
-		LongReal mLastUpdateTime;
-
-        /// Time scale.
-        Ogre::Real mTimeScale;
-
-	public:
-        /** Number of seconds per day; exactly 60*60*24.
-         */
-        static const LongReal SECONDS_PER_DAY;
-
-		/** Constructor.
-		 */
-		UniversalClock ();
-
-		/** Sets the time scale.
-		 * @param scale The new time scale. If negative, time will move backwards; 2.0 means double speed...
-		 */
-		void setTimeScale (const Ogre::Real scale);
-
-		/** Gets the time scale.
-		 *  @return The current time scale. Defaults to 1.
-		 */
-		Ogre::Real getTimeScale () const;
-
-		/** Updates the clock.
-		 *  @param time The time to be added to the clock. It will beaffected by the time scale.
-		 */
-		void update (const Ogre::Real time);
-
-        /** Set the current time as a julian day.
-         *  Set the current time as a julian day, which you build using one
-         *  of the static getJulianDayFromXXX functions.
-         *  Defaults to J2000 (noon january 1st)
-         */
-        void setJulianDay(LongReal value);
-
-        /** Set the current time as a gregorian date.
-         *  This is here as an easy to use function.
-         */
-        void setGregorianDateTime(
-                int year, int month, int day,
-                int hour, int minute, double second);
-
-        /** Get current julian day.
-         */
-        LongReal getJulianDay() const;
-
-        /** Get the difference in julian day between this and the last update.
-         *  This is most likely very small and unprecise.
-         */
-        LongReal getJulianDayDifference() const;
-
-        /** Get the current julian second (getJulianDay * SECONDS_PER_DAY)
-         *  This is most likely very very large and unprecise.
-         */
-        LongReal getJulianSecond() const;
-
-        /** Get the difference in seconds between this and the last update.
-         *  This is what you want for per-frame updates.
-         */
-        LongReal getJulianSecondDifference() const;
-    };
-}
-
-#endif //UNIVERSALCLOCK_H
diff --git a/extern/caelum/resources/AtmosphereDepth.png b/extern/caelum/resources/AtmosphereDepth.png
deleted file mode 100755
index afc6ff8c92..0000000000
Binary files a/extern/caelum/resources/AtmosphereDepth.png and /dev/null differ
diff --git a/extern/caelum/resources/CaelumGroundFog.cg b/extern/caelum/resources/CaelumGroundFog.cg
deleted file mode 100755
index 3f10bf3aaf..0000000000
--- a/extern/caelum/resources/CaelumGroundFog.cg
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-// Returns (exp(x) - 1) / x; avoiding division by 0.
-// lim when x -> 0 is 1.
-float expdiv(float x) {
-    if (abs(x) < 0.0001) {
-        return 1;
-    } else {
-        return (exp(x) - 1) / x;
-    }
-}
-
-// Return fogging through a layer of fog which drops exponentially by height.
-//
-// Standard exp fog with constant density would return (1 - exp(-density * dist)).
-// This function assumes a variable density vd = exp(-verticalDecay * h - baseLevel)
-// Full computation is exp(density * dist / (h2 - h1) * int(h1, h2, exp(-verticalDecay * (h2 - h1)))).
-//
-// This will gracefully degrade to standard exp fog in verticalDecay is 0; without throwing NaNs.
-float ExpGroundFog (
-    float dist, float h1, float h2,
-    float density, float verticalDecay, float baseLevel)
-{
-    float deltaH = (h2 - h1);
-    return 1 - exp (-density * dist * exp(verticalDecay * (baseLevel - h1)) * expdiv(-verticalDecay * deltaH));
-}
-
-// Just like ExpGroundFog with h2 = positive infinity
-// When h2 == negative infinity the value is always +1.
-float ExpGroundFogInf (
-    float invSinView, float h1,
-    float density, float verticalDecay, float baseLevel)
-{
-    return 1 - exp (-density * invSinView * exp(verticalDecay * (baseLevel - h1)) * (1 / verticalDecay));
-}
-
-// Entry point for GroundFog vertex program.
-void GroundFog_vp
-(
-		float4 position : POSITION,
-		
-		out float4 oPosition : POSITION,
-		out float4 worldPos : TEXCOORD0,
-		
-		uniform float4x4 worldViewProj,
-		uniform float4x4 world
-) {
-	oPosition = mul(worldViewProj, position);
-	worldPos = mul(world, position);
-}
-
-// Entry point for GroundFog fragment program.
-void GroundFog_fp
-(
-		in float3 worldPos : TEXCOORD0,
-
-		uniform float3 camPos,
-		uniform float4 fogColour,
-		uniform float fogDensity,
-		uniform float fogVerticalDecay,
-		uniform float fogGroundLevel,
-				
-		out float4 oCol : COLOR
-) {
-	float h1 = camPos.y;
-	float h2 = worldPos.y;
-	float dist = length(camPos - worldPos);
-	float fog = ExpGroundFog(
-	        dist, h1, h2,
-	        fogDensity, fogVerticalDecay, fogGroundLevel);
-
-	oCol.rgb = fogColour.rgb;
-	oCol.a = fog;
-}
-
-// Entry point for GroundFogDome vertex program.
-void GroundFogDome_vp
-(
-		in float4 position : POSITION,
-		out float4 oPosition : POSITION,
-		out float3 relPosition : TEXCOORD0,
-		uniform float4x4 worldViewProj
-) {
-	oPosition = mul(worldViewProj, position);
-	relPosition = normalize(position.xyz);
-}
-
-// Entry point for the GroundFogDome fragment program.
-void GroundFogDome_fp
-(
-		in float3 relPosition : TEXCOORD0,
-
-		uniform float cameraHeight,
-		uniform float4 fogColour,
-		uniform float fogDensity,
-		uniform float fogVerticalDecay,
-		uniform float fogGroundLevel,
-
-		out float4 oCol : COLOR
-) {
-	// Fog magic.
-	float invSinView = 1 / (relPosition.y);
-	float h1 = cameraHeight;
-	float aFog;
-
-    if (fogVerticalDecay < 1e-7) {
-        // A value of zero of fogVerticalDecay would result in maximum (1) aFog everywhere.
-        // Output 0 zero instead to disable.
-        aFog = 0;
-    } else {
-	    if (invSinView < 0) {
-		    // Gazing into the abyss
-		    aFog = 1;
-	    } else {
-		    aFog = saturate (ExpGroundFogInf (
-			        invSinView, h1,
-			        fogDensity, fogVerticalDecay, fogGroundLevel));
-	    }
-    }
-	
-	oCol.a = aFog;
-	oCol.rgb = fogColour.rgb;
-}
\ No newline at end of file
diff --git a/extern/caelum/resources/CaelumLayeredClouds.cg b/extern/caelum/resources/CaelumLayeredClouds.cg
deleted file mode 100755
index a5cbce5107..0000000000
--- a/extern/caelum/resources/CaelumLayeredClouds.cg
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-// Global cloud textures
-sampler cloud_shape1 : register(s0);
-sampler cloud_shape2 : register(s1);
-sampler cloud_detail : register(s2);
-
-// Get cloud layer intensity at a certain point.
-float LayeredClouds_intensity
-(
-        in float2   pos,
-        float       cloudMassInvScale,
-        float       cloudDetailInvScale,
-        float2      cloudMassOffset,
-        float2      cloudDetailOffset,
-        float       cloudMassBlend,
-        float       cloudDetailBlend,
-        float       cloudCoverageThreshold
-)
-{
-	// Calculate the base alpha
-	float2 finalMassOffset = cloudMassOffset + pos;
-	float aCloud = lerp(tex2D(cloud_shape1, finalMassOffset * cloudMassInvScale).r,
-						tex2D(cloud_shape2, finalMassOffset * cloudMassInvScale).r, 
-						cloudMassBlend);
-	float aDetail = tex2D(cloud_detail, (cloudDetailOffset + pos) * cloudDetailInvScale).r;
-	aCloud = (aCloud + aDetail * cloudDetailBlend) / (1 + cloudDetailBlend);
-	return max(0, aCloud - cloudCoverageThreshold);
-}
-
-// Entry point for Cloud vertex program.
-void LayeredClouds_vp
-(
-		in float4 position : POSITION,
-		in float2 uv : TEXCOORD0,
-		
-		uniform float4x4 worldViewProj,
-		uniform float4x4 worldMatrix,
-		uniform float3 sunDirection,
-
-		out float4 oPosition : POSITION,
-		out float2 oUv : TEXCOORD0,
-		out float3 relPosition : TEXCOORD1,
-		out float sunGlow : TEXCOORD2,
-		out float4 worldPosition : TEXCOORD3
-) {
-
-	oPosition = mul(worldViewProj, position);
-	worldPosition = mul(worldMatrix, position);
-	oUv = uv;
-
-    // This is the relative position, or view direction.
-	relPosition = normalize (position.xyz);
-
-    // Calculate the angle between the direction of the sun and the current
-    // view direction. This we call "glow" and ranges from 1 next to the sun
-    // to -1 in the opposite direction.
-	sunGlow = dot (relPosition, normalize (-sunDirection));
-}
-
-float4 OldCloudColor
-(
-		float2       uv,
-		float3       relPosition,
-		float        sunGlow,
-
-        uniform float   cloudMassInvScale,
-        uniform float   cloudDetailInvScale,
-        uniform float2  cloudMassOffset,
-        uniform float2  cloudDetailOffset,
-        uniform float   cloudMassBlend,
-        uniform float   cloudDetailBlend,
-
-        uniform float   cloudCoverageThreshold,
-
-        uniform float4  sunColour,
-        uniform float4  fogColour,
-        uniform float   cloudSharpness,
-        uniform float   cloudThickness
-
-) {
-    // Initialize output.
-	float4 oCol = float4(1, 1, 1, 0);
-	
-	// Get cloud intensity.
-	float intensity = LayeredClouds_intensity
-    (
-            uv,
-            cloudMassInvScale,
-            cloudDetailInvScale,
-            cloudMassOffset,
-            cloudDetailOffset,
-            cloudMassBlend,
-            cloudDetailBlend,
-            cloudCoverageThreshold
-    );
-
-	// Opacity is exponential.
-	float aCloud = saturate(exp(cloudSharpness * intensity) - 1);
-
-	float shine = pow(saturate(sunGlow), 8) / 4;
-	sunColour.rgb *= 1.5;
-	float3 cloudColour = fogColour.rgb * (1 - intensity / 3);
-	float thickness = saturate(0.8 - exp(-cloudThickness * (intensity + 0.2 - shine)));
-
-	oCol.rgb = lerp(sunColour.rgb, cloudColour.rgb, thickness);
-	oCol.a = aCloud;	
-	
-	return oCol;
-}
-
-//Converts a color from RGB to YUV color space
-//the rgb color is in [0,1] [0,1] [0,1] range
-//the yuv color is in [0,1] [-0.436,0.436] [-0.615,0.615] range
-float3 YUVfromRGB(float3 col)
-{
-    return float3(dot(col, float3(0.299,0.587,0.114)),
-				  dot(col, float3(-0.14713,-0.28886,0.436)),
-				  dot(col, float3(0.615,-0.51499,-0.10001)));
-}
-
-float3 RGBfromYUV(float3 col)
-{
-    return float3(dot(col,float3(1,0,1.13983)),
-				  dot(col,float3(1,-0.39465,-0.58060)),
-				  dot(col,float3(1,2.03211,0)));
-}
-
-// Creates a color that has the intensity of col1 and the chrominance of col2
-float3 MagicColorMix(float3 col1, float3 col2)
-{
-    return saturate(RGBfromYUV(float3(YUVfromRGB(col1).x, YUVfromRGB(col2).yz)));
-}
-
-// Entry point for Cloud fragment program.
-void LayeredClouds_fp
-(
-		in float2       uv : TEXCOORD0,
-		in float3       relPosition : TEXCOORD1,
-		in float        sunGlow : TEXCOORD2,
-		in float4 worldPosition : TEXCOORD3,			
-
-        uniform float   cloudMassInvScale,
-        uniform float   cloudDetailInvScale,
-        uniform float2  cloudMassOffset,
-        uniform float2  cloudDetailOffset,
-        uniform float   cloudMassBlend,
-        uniform float   cloudDetailBlend,
-
-        uniform float   cloudCoverageThreshold,
-
-        uniform float4  sunLightColour,
-        uniform float4  sunSphereColour,
-        uniform float4  fogColour,
-        uniform float4	sunDirection,
-        uniform float   cloudSharpness,
-        uniform float   cloudThickness,
-        uniform float3	camera_position,
-
-        uniform float3	fadeDistMeasurementVector,
-        uniform float	layerHeight,
-        uniform float	cloudUVFactor,
-        uniform float	heightRedFactor,
-
-        uniform float   nearFadeDist,
-        uniform float   farFadeDist,
-
-		out float4 oCol : COLOR
-) {
-	uv *= cloudUVFactor;
-
-    oCol = OldCloudColor(
-            uv, relPosition, sunGlow,
-		    cloudMassInvScale, cloudDetailInvScale,
-            cloudMassOffset, cloudDetailOffset,
-            cloudMassBlend, cloudDetailBlend,
-            cloudCoverageThreshold,
-		    sunLightColour,
-            fogColour,
-            cloudSharpness,
-            cloudThickness);
-	oCol.r += layerHeight / heightRedFactor;
-	
-	//float dist = distance(worldPosition.xyz, camera_position.xyz);
-	float dist = length((worldPosition - camera_position) * fadeDistMeasurementVector);
-	float aMod = 1;	
-	if (dist > nearFadeDist) {
-        aMod = saturate(lerp(0, 1, (farFadeDist - dist) / (farFadeDist - nearFadeDist)));
-    }
-    float alfa = oCol.a * aMod;
-	
-	float3 cloudDir = normalize(
-	         float3(worldPosition.x, layerHeight, worldPosition.y) - camera_position);
-	float angleDiff = saturate(dot(cloudDir, normalize(sunDirection.xyz)));
-	
-	float3 lCol = lerp(oCol.rgb, MagicColorMix(oCol.rgb, sunSphereColour.rgb), angleDiff);
-	oCol.rgb = lerp(lCol, oCol.rgb, alfa);
-	oCol.a = alfa;
-}
diff --git a/extern/caelum/resources/CaelumPhaseMoon.cg b/extern/caelum/resources/CaelumPhaseMoon.cg
deleted file mode 100755
index d7f72f35ac..0000000000
--- a/extern/caelum/resources/CaelumPhaseMoon.cg
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-// Get how much of a certain point on the moon is seen (or not) because of the phase.
-// uv is the rect position on moon; as seen from the earth.
-// phase ranges from 0 to 2
-float MoonPhaseFactor(float2 uv, float phase)
-{
-    float alpha = 1.0;
-
-    float srefx = uv.x - 0.5;
-    float refx = abs(uv.x - 0.5);
-    float refy = abs(uv.y - 0.5);
-    float refxfory = sqrt(0.25 - refy * refy);
-    float xmin = -refxfory;
-    float xmax = refxfory;
-    float xmin1 = (xmax - xmin) * (phase / 2) + xmin;
-    float xmin2 = (xmax - xmin) * phase + xmin;
-    if (srefx < xmin1) {
-        alpha = 0;
-    } else if (srefx < xmin2 && xmin1 != xmin2) {
-        alpha = (srefx - xmin1) / (xmin2 - xmin1);
-    }
-
-    return alpha;
-}
-
-void PhaseMoonFP
-(
-    in float2 uv: TEXCOORD0,
-    uniform float phase,
-    uniform sampler2D moonDisc: register(s0), 
-    out float4 outcol : COLOR
-)
-{
-    outcol = tex2D(moonDisc, uv);
-    float alpha = MoonPhaseFactor(uv, phase);
-
-    // Get luminance from the texture.
-    float lum = dot(outcol.rgb, float3(0.3333, 0.3333, 0.3333));
-    //float lum = dot(outcol.rgb, float3(0.3, 0.59, 0.11));
-    outcol.a = min(outcol.a, lum * alpha);
-    outcol.rgb /= lum;
-}
diff --git a/extern/caelum/resources/CaelumPointStarfield.cg b/extern/caelum/resources/CaelumPointStarfield.cg
deleted file mode 100755
index 0155d40fc5..0000000000
--- a/extern/caelum/resources/CaelumPointStarfield.cg
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-void StarPointVP
-(
-	in float4 in_position : POSITION,
-	in float3 in_texcoord : TEXCOORD0,
-	
-	uniform float4x4 worldviewproj_matrix,
-
-    // These params are in clipspace; not pixels
-    uniform float mag_scale,
-    uniform float mag0_size,
-    uniform float min_size,
-    uniform float max_size,
-    uniform float render_target_flipping,
-
-    // width/height
-    uniform float aspect_ratio,
-	
-	out float2 out_texcoord : TEXCOORD0,
-	out float4 out_position : POSITION,
-	out float4 out_color : COLOR
-)
-{
-    float4 in_color = float4(1, 1, 1, 1);
-    out_position = mul(worldviewproj_matrix, in_position);
-    out_texcoord = in_texcoord.xy;
-
-    float magnitude = in_texcoord.z;
-    float size = exp(mag_scale * magnitude) * mag0_size;
-
-    // Fade below minSize.
-    float fade = saturate(size / min_size);
-    out_color = float4(in_color.rgb, fade * fade);
-
-    // Clamp size to range.
-    size = clamp(size, min_size, max_size);
-
-    // Splat the billboard on the screen.
-    out_position.xy +=
-            out_position.w *
-            in_texcoord.xy *
-            float2(size, size * aspect_ratio * render_target_flipping);
-}
-
-void StarPointFP
-(
-	in float4 in_color : COLOR,
-	in float2 in_texcoord : TEXCOORD0,
-
-	out float4 out_color : COLOR
-)
-{
-    out_color = in_color;
-    float sqlen = dot(in_texcoord, in_texcoord);
-
-    // A gaussian bell of sorts.
-    out_color.a *= 1.5 * exp(-(sqlen * 8));
-}
diff --git a/extern/caelum/resources/CaelumSkyDome.cg b/extern/caelum/resources/CaelumSkyDome.cg
deleted file mode 100755
index 7ac81bde87..0000000000
--- a/extern/caelum/resources/CaelumSkyDome.cg
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-float bias (float b, float x)
-{
-	return pow (x, log (b) / log (0.5));
-}
-
-float4 sunlightInscatter
-(
-    float4 sunColour,
-    float absorption,
-    float incidenceAngleCos,
-    float sunlightScatteringFactor
-)
-{
-	float scatteredSunlight = bias (sunlightScatteringFactor * 0.5, incidenceAngleCos);
-
-	sunColour = sunColour * (1 - absorption) * float4 (0.9, 0.5, 0.09, 1);
-	
-    return sunColour * scatteredSunlight;
-}
-
-float fogExp (float z, float density) {
-	return 1 - clamp (pow (2.71828, -z * density), 0, 1);
-}
-
-void SkyDomeVP
-(
-    in float4 position : POSITION,
-    in float4 normal : NORMAL,
-    in float2 uv : TEXCOORD0,
-
-    uniform float lightAbsorption,
-    uniform float4x4 worldViewProj,
-    uniform float3 sunDirection,
-
-    out float4 oPosition : POSITION,
-    out float4 oCol : COLOR, 
-    out float2 oUv : TEXCOORD0,
-    out float incidenceAngleCos : TEXCOORD1,
-    out float y : TEXCOORD2, 
-    out float3 oNormal : TEXCOORD3
-)
-{
-	sunDirection = normalize (sunDirection);
-	normal = normalize (normal);
-	float cosine = dot (-sunDirection, normal);
-	incidenceAngleCos = -cosine;
-
-	y = -sunDirection.y;
-
-	oPosition = mul (worldViewProj, position);
-	oCol = float4 (1, 1, 1, 1);
-	oUv = uv;
-	oNormal = -normal.xyz;
-}
-
-void SkyDomeFP
-(
-    float4 col : COLOR, 
-    float2 uv : TEXCOORD0,
-    float incidenceAngleCos : TEXCOORD1,
-    float y : TEXCOORD2, 
-    float3 normal : TEXCOORD3, 
-
-    uniform sampler gradientsMap : register(s0), 
-    uniform sampler1D atmRelativeDepth : register(s1), 
-    uniform float4 hazeColour, 
-    uniform float offset,
-
-    out float4 oCol : COLOR
-)
-{
-	float4 sunColour = float4 (3, 3, 3, 1);
-
-#ifdef HAZE
-	float fogDensity = 15;
-	// Haze amount calculation
-	float invHazeHeight = 100;
-	float haze = fogExp (pow (clamp (1 - normal.y, 0, 1), invHazeHeight), fogDensity);
-#endif // HAZE
-
-	// Pass the colour
-	oCol = tex2D (gradientsMap, uv + float2 (offset, 0)) * col;
-
-	// Sunlight inscatter
-	if (incidenceAngleCos > 0)
-    {
-		float sunlightScatteringFactor = 0.05;
-		float sunlightScatteringLossFactor = 0.1;
-		float atmLightAbsorptionFactor = 0.1;
-		
-		oCol.rgb += sunlightInscatter (
-                sunColour, 
-                clamp (atmLightAbsorptionFactor * (1 - tex1D (atmRelativeDepth, y).r), 0, 1), 
-                clamp (incidenceAngleCos, 0, 1), 
-                sunlightScatteringFactor).rgb * (1 - sunlightScatteringLossFactor);
-	}
-
-#ifdef HAZE
-	// Haze pass
-	hazeColour.a = 1;
-	oCol = oCol * (1 - haze) + hazeColour * haze;
-#endif // HAZE
-}
-
-void HazeVP
-(
-        in float4 position : POSITION,
-		in float4 normal : NORMAL,
-
-        uniform float4x4 worldViewProj,
-        uniform float4 camPos, 
-        uniform float3 sunDirection,
-
-        out float4 oPosition : POSITION,
-        out float haze : TEXCOORD0, 
-        out float2 sunlight : TEXCOORD1
-)
-{
-	sunDirection = normalize (sunDirection);
-	oPosition = mul(worldViewProj, position);
-	haze = length (camPos - position);
-	sunlight.x = dot (-sunDirection, normalize (position - camPos));
-	sunlight.y = -sunDirection.y;
-}
-
-void HazeFP
-(
-        in float haze : TEXCOORD0, 
-        in float2 sunlight : TEXCOORD1, 
-
-        uniform sampler1D atmRelativeDepth : register(s0), 
-        uniform sampler2D gradientsMap : register (s1), 
-        uniform float4 fogColour,
-
-        out float4 oCol : COLOR
-)
-{
-	float incidenceAngleCos = sunlight.x;
-	float y = sunlight.y;
-
-	float4 sunColour = float4 (3, 2.5, 1, 1);
-
-    // Factor determining the amount of light lost due to absorption
-	float atmLightAbsorptionFactor = 0.1; 
-	float fogDensity = 15;
-
-	haze = fogExp (haze * 0.005, atmLightAbsorptionFactor);
-
-	// Haze amount calculation
-	float invHazeHeight = 100;
-	float hazeAbsorption = fogExp (pow (1 - y, invHazeHeight), fogDensity);
-
-	float4 hazeColour;
-	hazeColour = fogColour;
-	if (incidenceAngleCos > 0) {
-        // Factor determining the amount of scattering for the sun light
-		float sunlightScatteringFactor = 0.1;
-        // Factor determining the amount of sun light intensity lost due to scattering
-		float sunlightScatteringLossFactor = 0.3;	
-
-		float4 sunlightInscatterColour = sunlightInscatter (
-                sunColour, 
-                clamp ((1 - tex1D (atmRelativeDepth, y).r) * hazeAbsorption, 0, 1), 
-                clamp (incidenceAngleCos, 0, 1), 
-                sunlightScatteringFactor) * (1 - sunlightScatteringLossFactor);
-		hazeColour.rgb =
-                hazeColour.rgb * (1 - sunlightInscatterColour.a) +
-                sunlightInscatterColour.rgb * sunlightInscatterColour.a * haze;
-	}
-
-	oCol = hazeColour;
-	oCol.a = haze;
-}
diff --git a/extern/caelum/resources/CloudCoverLookup.png b/extern/caelum/resources/CloudCoverLookup.png
deleted file mode 100755
index 9bc45755fb..0000000000
Binary files a/extern/caelum/resources/CloudCoverLookup.png and /dev/null differ
diff --git a/extern/caelum/resources/DepthComposer.cg b/extern/caelum/resources/DepthComposer.cg
deleted file mode 100755
index 6a88308eb7..0000000000
--- a/extern/caelum/resources/DepthComposer.cg
+++ /dev/null
@@ -1,253 +0,0 @@
-//
-// This file is part of Caelum.
-// See http://www.ogre3d.org/wiki/index.php/Caelum 
-// 
-// Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-// 
-// Caelum is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Caelum is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public License
-// along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#ifdef EXP_GROUND_FOG
-
-// Returns (exp(x) - 1) / x; avoiding division by 0.
-// lim when x -> 0 is 1.
-float expdiv(float x) {
-    if (abs(x) < 0.0001) {
-        return 1;
-    } else {
-        return (exp(x) - 1) / x;
-    }
-}
-
-// Return fogging through a layer of fog which drops exponentially by height.
-//
-// Standard exp fog with constant density would return (1 - exp(-density * dist)).
-// This function assumes a variable density vd = exp(-verticalDecay * h - baseLevel)
-// Full computation is exp(density * dist / (h2 - h1) * int(h1, h2, exp(-verticalDecay * (h2 - h1)))).
-//
-// This will gracefully degrade to standard exp fog in verticalDecay is 0; without throwing NaNs.
-float ExpGroundFog (
-    float dist, float h1, float h2,
-    float density, float verticalDecay, float baseLevel)
-{
-    float deltaH = (h2 - h1);
-    return 1 - exp (-density * dist * exp(verticalDecay * (baseLevel - h1)) * expdiv(-verticalDecay * deltaH));
-}
-
-#endif // EXP_GROUND_FOG
-
-#ifdef SKY_DOME_HAZE
-
-float bias (float b, float x)
-{
-    return pow (x, log (b) / log (0.5));
-}
-
-float4 sunlightInscatter
-(
-    float4 sunColour,
-    float absorption,
-    float incidenceAngleCos,
-    float sunlightScatteringFactor
-)
-{
-    float scatteredSunlight = bias (sunlightScatteringFactor * 0.5, incidenceAngleCos);
-
-    sunColour = sunColour * (1 - absorption) * float4 (0.9, 0.5, 0.09, 1);
-    
-    return sunColour * scatteredSunlight;
-}
-
-float fogExp (float z, float density) {
-    return 1 - clamp (pow (2.71828, -z * density), 0, 1);
-}
-
-uniform sampler1D atmRelativeDepth : register(HAZE_DEPTH_TEXTURE);
-
-float4 CalcHaze
-(
-        float3 worldPos,
-        float3 worldCamPos,
-        float3 hazeColour,
-        float3 sunDirection
-)
-{
-    float haze = length (worldCamPos - worldPos);
-    float incidenceAngleCos = dot (-sunDirection, normalize (worldPos - worldCamPos));
-    float y = -sunDirection.y;
-
-    float4 sunColour = float4 (3, 2.5, 1, 1);
-
-    // Factor determining the amount of light lost due to absorption
-    float atmLightAbsorptionFactor = 0.1; 
-    float fogDensity = 15;
-
-    haze = fogExp (haze * 0.005, atmLightAbsorptionFactor);
-
-    // Haze amount calculation
-    float invHazeHeight = 100;
-    float hazeAbsorption = fogExp (pow (1 - y, invHazeHeight), fogDensity);
-
-    if (incidenceAngleCos > 0) {
-        // Factor determining the amount of scattering for the sun light
-        float sunlightScatteringFactor = 0.1;
-        // Factor determining the amount of sun light intensity lost due to scattering
-        float sunlightScatteringLossFactor = 0.3;   
-
-        float4 sunlightInscatterColour = sunlightInscatter (
-                sunColour, 
-                clamp ((1 - tex1D (atmRelativeDepth, y).r) * hazeAbsorption, 0, 1), 
-                clamp (incidenceAngleCos, 0, 1), 
-                sunlightScatteringFactor) * (1 - sunlightScatteringLossFactor);
-        hazeColour =
-                hazeColour * (1 - sunlightInscatterColour.a) +
-                sunlightInscatterColour.rgb * sunlightInscatterColour.a * haze;
-    }
-
-    return float4(hazeColour.rgb, haze);
-}
-
-#endif // SKY_DOME_HAZE
-
-void MainFP
-(
-    in float2 screenPos : TEXCOORD0,
-
-    uniform float4x4 invViewProjMatrix,
-    uniform float4 worldCameraPos,
-
-#if EXP_GROUND_FOG
-    uniform float groundFogDensity,
-    uniform float groundFogVerticalDecay,
-    uniform float groundFogBaseLevel,
-    uniform float4 groundFogColour,
-#endif // EXP_GROUND_FOG
-
-#if SKY_DOME_HAZE
-    uniform float3 hazeColour,
-    uniform float3 sunDirection,
-#endif // SKY_DOME_HAZE
-
-    sampler screenTexture: register(s0),
-    sampler depthTexture: register(s1),
-
-    out float4 outColor : COLOR 
-)
-{
-    float4 inColor = tex2D(screenTexture, screenPos);
-    float inDepth = tex2D(depthTexture, screenPos).r;
-
-    // Build normalized device coords; after the perspective divide.
-    //float4 devicePos = float4(1 - screenPos.x * 2, screenPos.y * 2 - 1, inDepth, 1);
-    //float4 devicePos = float4(screenPos.x * 2 - 1, 1 - screenPos.y * 2, 2 * inDepth - 1, 1);
-    float4 devicePos = float4(screenPos.x * 2 - 1, 1 - screenPos.y * 2, inDepth, 1);
-
-    // Go back from device to world coordinates.
-    float4 worldPos = mul(invViewProjMatrix, devicePos);
-
-    // Now undo the perspective divide and go back to "normal" space.
-    worldPos /= worldPos.w;
-    
-    float4 color = inColor;
-
-#if DEBUG_DEPTH_RENDER
-    //color = abs(float4(inDepth, inDepth, inDepth, 1));
-    color = worldPos * float4(0.001, 0.01, 0.001, 1);
-#endif // DEBUG_DEPTH_RENDER
-
-#if EXP_GROUND_FOG
-    // Ye olde ground fog.
-    float h1 = worldCameraPos.y;
-    float h2 = worldPos.y;
-    float dist = length(worldCameraPos - worldPos);
-    float fogFactor = ExpGroundFog(
-            dist, h1, h2,
-            groundFogDensity, groundFogVerticalDecay, groundFogBaseLevel);
-    color = lerp(color, groundFogColour, fogFactor);
-#endif // EXP_GROUND_FOG
-
-#if SKY_DOME_HAZE
-    float4 hazeValue = CalcHaze (
-            worldPos.xyz,
-            worldCameraPos.xyz,
-            hazeColour,
-            sunDirection);
-    color.rgb = lerp(color.rgb, hazeValue.rgb, hazeValue.a);
-#endif // SKY_DOME_HAZE
-
-    outColor = color;
-}
-
-void DepthRenderVP
-(
-    float4 inPos : POSITION,
-
-    uniform float4x4 wvpMatrix,
-
-    out float4 magic : TEXCOORD0,
-    out float4 outPos : POSITION
-)
-{
-    // Standard transform.
-    outPos = mul(wvpMatrix, inPos);
-
-    // Depth buffer is z/w.
-    // Let the GPU lerp the components of outPos.
-    magic = outPos;
-}
-
-void DepthRenderFP
-(
-    in float4 magic : TEXCOORD0,
-    out float4 output : COLOR   
-)
-{
-    output = float4(magic.z / magic.w);
-    //output = float4(magic.xy / magic.w, 1, 1);
-}
-
-void DepthRenderAlphaRejectionVP
-(
-    float4 inPos : POSITION,
-    float4 inTexcoord : TEXCOORD0,
-
-    uniform float4x4 wvpMatrix,
-
-    out float4 outTexcoord : TEXCOORD0,
-    out float4 magic : TEXCOORD1,
-    out float4 outPos : POSITION
-)
-{
-    // Standard transform.
-    outPos = mul(wvpMatrix, inPos);
-
-    // Depth buffer is z/w.
-    // Let the GPU lerp the components of outPos.
-    magic = outPos;
-
-    outTexcoord = inTexcoord;
-}
-
-void DepthRenderAlphaRejectionFP
-(
-    in float4 texcoord : TEXCOORD0,
-    in float4 magic : TEXCOORD1,
-    sampler mainTex: register(s0),
-    out float4 output : COLOR
-)
-{
-    float4 texvalue = tex2D(mainTex, texcoord.xy);
-//    texvalue.a = sin(100 * texcoord.x) + sin(100 * texcoord.y);
-    output = float4(float3(magic.z / magic.w), texvalue.a);
-}
diff --git a/extern/caelum/resources/DepthComposer.compositor b/extern/caelum/resources/DepthComposer.compositor
deleted file mode 100755
index 466469804d..0000000000
--- a/extern/caelum/resources/DepthComposer.compositor
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// This file is part of Caelum.
-// See http://www.ogre3d.org/wiki/index.php/Caelum 
-// 
-// Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-// 
-// Caelum is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Caelum is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public License
-// along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-compositor Caelum/DepthComposer_DebugDepthRender
-{
-    technique
-    {
-        texture rt0 target_width target_height PF_A8R8G8B8
-
-        target rt0
-        {
-            input previous
-        }
-
-        target_output
-        {
-            input none
-
-            pass render_quad
-            {
-                material Caelum/DepthComposer_DebugDepthRender
-                input 0 rt0
-            }
-        }
-    }
-}
-
-compositor Caelum/DepthComposer_Dummy
-{
-    technique
-    {
-        texture rt0 target_width target_height PF_A8R8G8B8
-
-        target rt0
-        {
-            input previous
-        }
-
-        target_output
-        {
-            input none
-
-            pass render_quad
-            {
-                material Caelum/DepthComposer_Dummy
-                input 0 rt0
-            }
-        }
-    }
-}
-
-compositor Caelum/DepthComposer_ExpGroundFog
-{
-    technique
-    {
-        texture rt0 target_width target_height PF_A8R8G8B8
-
-        target rt0
-        {
-            input previous
-        }
-
-        target_output
-        {
-            input none
-
-            pass render_quad
-            {
-                material Caelum/DepthComposer_ExpGroundFog
-                input 0 rt0
-            }
-        }
-    }
-}
-
-compositor Caelum/DepthComposer_SkyDomeHaze
-{
-    technique
-    {
-        texture rt0 target_width target_height PF_A8R8G8B8
-
-        target rt0
-        {
-            input previous
-        }
-
-        target_output
-        {
-            input none
-
-            pass render_quad
-            {
-                material Caelum/DepthComposer_SkyDomeHaze
-                input 0 rt0
-            }
-        }
-    }
-}
-
-compositor Caelum/DepthComposer_SkyDomeHaze_ExpGroundFog
-{
-    technique
-    {
-        texture rt0 target_width target_height PF_A8R8G8B8
-
-        target rt0
-        {
-            input previous
-        }
-
-        target_output
-        {
-            input none
-
-            pass render_quad
-            {
-                material Caelum/DepthComposer_SkyDomeHaze_ExpGroundFog
-                input 0 rt0
-            }
-        }
-    }
-}
diff --git a/extern/caelum/resources/DepthComposer.material b/extern/caelum/resources/DepthComposer.material
deleted file mode 100755
index 510b7c97e8..0000000000
--- a/extern/caelum/resources/DepthComposer.material
+++ /dev/null
@@ -1,302 +0,0 @@
-//
-// This file is part of Caelum.
-// See http://www.ogre3d.org/wiki/index.php/Caelum 
-// 
-// Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-// 
-// Caelum is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Caelum is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public License
-// along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-fragment_program Caelum/DepthComposerFP_Dummy cg
-{
-	source DepthComposer.cg
-	entry_point MainFP
-	profiles ps_3_0 arbfp1
-	
-	default_params
-	{
-    }
-}
-
-fragment_program Caelum/DepthComposerFP_DebugDepthRender cg
-{
-	source DepthComposer.cg
-	entry_point MainFP
-	profiles ps_3_0 arbfp1
-	compile_arguments -DDEBUG_DEPTH_RENDER=1
-	
-	default_params
-	{
-        param_named invViewProjMatrix float4x4 0 0 0 0  0 0 0 0  0 0 0 0  0 0 0 0
-    }
-}
-
-fragment_program Caelum/DepthComposerFP_ExpGroundFog cg
-{
-	source DepthComposer.cg
-	entry_point MainFP
-	profiles ps_3_0 arbfp1
-	compile_arguments -DEXP_GROUND_FOG=1
-	
-	default_params
-	{
-        param_named invViewProjMatrix float4x4 0 0 0 0  0 0 0 0  0 0 0 0  0 0 0 0
-
-        param_named worldCameraPos float4 0 0 0 0
-
-        param_named groundFogDensity float 0.1
-        param_named groundFogVerticalDecay float 0.2
-        param_named groundFogBaseLevel float 5
-		param_named groundFogColour float4 1 0 1 1
-    }
-}
-
-fragment_program Caelum/DepthComposerFP_SkyDomeHaze cg
-{
-	source DepthComposer.cg
-	entry_point MainFP
-	profiles ps_3_0 arbfp1
-	compile_arguments -DSKY_DOME_HAZE=1 -DHAZE_DEPTH_TEXTURE=s2
-	
-	default_params
-	{
-        param_named invViewProjMatrix float4x4 0 0 0 0  0 0 0 0  0 0 0 0  0 0 0 0
-
-        param_named worldCameraPos float4 0 0 0 0
-
-        param_named sunDirection float3 0 1 0
-        param_named hazeColour float3 0.1 0.2 0.6
-    }
-}
-
-fragment_program Caelum/DepthComposerFP_SkyDomeHaze_ExpGroundFog cg
-{
-	source DepthComposer.cg
-	entry_point MainFP
-	profiles ps_3_0 arbfp1
-	compile_arguments -DEXP_GROUND_FOG=1 -DSKY_DOME_HAZE=1 -DHAZE_DEPTH_TEXTURE=s2
-	
-	default_params
-	{
-        param_named invViewProjMatrix float4x4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-
-        param_named worldCameraPos float4 0 0 0 0
-
-        param_named sunDirection float3 0 1 0
-        param_named hazeColour float3 0.1 0.2 0.6
-
-        param_named groundFogDensity float 0.1
-        param_named groundFogVerticalDecay float 0.2
-        param_named groundFogBaseLevel float 5
-		param_named groundFogColour float4 1 0 1 1
-    }
-}
-
-material Caelum/DepthRender
-{
-    technique Default
-    {
-        pass Main
-        {
-            // This is required!
-            depth_write on
-            depth_check on
-            
-            vertex_program_ref Caelum/DepthRenderVP
-            {
-            }
-
-            fragment_program_ref Caelum/DepthRenderFP
-            {
-            }
-        }
-    }
-}
-
-// Material for rendering depth of an alpha-rejection material.
-//
-// Unlike the regular Caelum/DepthRender this also outputs alpha from a texture.
-// The shaders (VP/FP) can be trivially used in more complex materials.
-material Caelum/DepthRenderAlphaRejection
-{
-    technique Default
-    {
-        pass Main
-        {
-            depth_write on
-            depth_check on
-            
-            vertex_program_ref Caelum/DepthRenderAlphaRejectionVP
-            {
-            }
-
-            fragment_program_ref Caelum/DepthRenderAlphaRejectionFP
-            {
-            }
-
-            alpha_rejection greater 128
-            texture_unit Main
-            {
-            }
-        }
-    }
-}
-
-material Caelum/DepthComposer_Dummy
-{
-	technique Default
-	{
-		pass Main
-		{	
-			vertex_program_ref Caelum/MinimalCompositorVP
-			{
-			}
-			
-			fragment_program_ref Caelum/DepthComposerFP_Dummy
-			{
-			}
-			
-			texture_unit Screen
-			{		
-			    filtering none	
-			}
-
-			texture_unit Depth
-			{		
-			    filtering none	
-			}
-		}
-	}
-}
-
-material Caelum/DepthComposer_DebugDepthRender
-{
-	technique Default
-	{
-		pass Main
-		{	
-			vertex_program_ref Caelum/MinimalCompositorVP
-			{
-			}
-			
-			fragment_program_ref Caelum/DepthComposerFP_DebugDepthRender
-			{
-			}
-			
-			texture_unit Screen
-			{
-			    filtering none		
-			}
-
-			texture_unit Depth
-			{			
-			    filtering none		
-			}
-		}
-	}
-}
-
-material Caelum/DepthComposer_ExpGroundFog
-{
-	technique Default
-	{
-		pass Main
-		{	
-			vertex_program_ref Caelum/MinimalCompositorVP
-			{
-			}
-			
-			fragment_program_ref Caelum/DepthComposerFP_ExpGroundFog
-			{
-			}
-			
-			texture_unit Screen
-			{			
-			    filtering none		
-			}
-
-			texture_unit Depth
-			{			
-			    filtering none		
-			}
-		}
-	}
-}
-
-material Caelum/DepthComposer_SkyDomeHaze
-{
-	technique Default
-	{
-		pass Main
-		{	
-			vertex_program_ref Caelum/MinimalCompositorVP
-			{
-			}
-			
-			fragment_program_ref Caelum/DepthComposerFP_SkyDomeHaze
-			{
-			}
-			
-			texture_unit Screen
-			{			
-			    filtering none		
-			}
-
-			texture_unit Depth
-			{			
-			    filtering none		
-			}
-
-			texture_unit AtmosphereDepth
-			{			
-				texture AtmosphereDepth.png 1d
-				tex_address_mode clamp
-			}
-		}
-	}
-}
-
-material Caelum/DepthComposer_SkyDomeHaze_ExpGroundFog
-{
-	technique Default
-	{
-		pass Main
-		{	
-			vertex_program_ref Caelum/MinimalCompositorVP
-			{
-			}
-			
-			fragment_program_ref Caelum/DepthComposerFP_SkyDomeHaze_ExpGroundFog
-			{
-			}
-			
-			texture_unit Screen
-			{			
-			    filtering none		
-			}
-
-			texture_unit Depth
-			{			
-			    filtering none		
-			}
-
-			texture_unit AtmosphereDepth
-			{			
-				texture AtmosphereDepth.png 1d
-			    filtering bilinear		
-				tex_address_mode clamp
-			}
-		}
-	}
-}
diff --git a/extern/caelum/resources/DepthRender.program b/extern/caelum/resources/DepthRender.program
deleted file mode 100755
index fcce454dfa..0000000000
--- a/extern/caelum/resources/DepthRender.program
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// This file is part of Caelum.
-// See http://www.ogre3d.org/wiki/index.php/Caelum 
-// 
-// Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-// 
-// Caelum is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Caelum is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public License
-// along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-vertex_program Caelum/DepthRenderVP cg
-{
-    source DepthComposer.cg
-    entry_point DepthRenderVP
-	profiles vs_2_0 arbvp1
-
-    default_params
-    {
-        param_named_auto wvpMatrix worldviewproj_matrix
-    }
-}
-
-fragment_program Caelum/DepthRenderFP cg
-{
-    source DepthComposer.cg
-    entry_point DepthRenderFP
-	profiles ps_3_0 fp40 arbfp1
-}
-
-vertex_program Caelum/DepthRenderAlphaRejectionVP cg
-{
-    source DepthComposer.cg
-    entry_point DepthRenderAlphaRejectionVP
-	profiles vs_2_0 arbvp1
-
-    default_params
-    {
-        param_named_auto wvpMatrix worldviewproj_matrix
-    }
-}
-
-fragment_program Caelum/DepthRenderAlphaRejectionFP cg
-{
-    source DepthComposer.cg
-    entry_point DepthRenderAlphaRejectionFP
-	profiles ps_3_0 fp40 arbfp1
-}
diff --git a/extern/caelum/resources/EarthClearSky2.png b/extern/caelum/resources/EarthClearSky2.png
deleted file mode 100755
index f6d67bd1a0..0000000000
Binary files a/extern/caelum/resources/EarthClearSky2.png and /dev/null differ
diff --git a/extern/caelum/resources/GroundFog.material b/extern/caelum/resources/GroundFog.material
deleted file mode 100755
index 02848eac3d..0000000000
--- a/extern/caelum/resources/GroundFog.material
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-//This file is part of Caelum.
-//See http://www.ogre3d.org/wiki/index.php/Caelum 
-//
-//Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-//
-//Caelum is free software: you can redistribute it and/or modify
-//it under the terms of the GNU Lesser General Public License as published
-//by the Free Software Foundation, either version 3 of the License, or
-//(at your option) any later version.
-//
-//Caelum is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//GNU Lesser General Public License for more details.
-//
-//You should have received a copy of the GNU Lesser General Public License
-//along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-// Sample base material for using CaelumGroundFog.
-material CaelumGroundFogBase
-{
-	technique Default
-	{
-		pass Main
-		{
-			fog_override true none
-		}
-	
-		// Fog pass
-		pass CaelumGroundFog
-		{
-			vertex_program_ref CaelumGroundFogVP
-			{
-			}
-			
-			fragment_program_ref CaelumGroundFogFP
-			{
-			}
-			
-			scene_blend alpha_blend
-		}
-	}
-}
-
-material CaelumGroundFogDome
-{
-	receive_shadows off
-	
-    technique
-    {
-		pass
-		{
-			lighting off
-			depth_check off
-			depth_write off
-			fog_override true 
-			scene_blend alpha_blend
-			cull_hardware none
-			
-			vertex_program_ref CaelumGroundFogDomeVP
-			{
-			}
-			
-			fragment_program_ref CaelumGroundFogDomeFP
-			{
-			}
-		}
-	}
-}
\ No newline at end of file
diff --git a/extern/caelum/resources/GroundFog.program b/extern/caelum/resources/GroundFog.program
deleted file mode 100755
index 82afd7dc00..0000000000
--- a/extern/caelum/resources/GroundFog.program
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-//This file is part of Caelum.
-//See http://www.ogre3d.org/wiki/index.php/Caelum 
-//
-//Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-//
-//Caelum is free software: you can redistribute it and/or modify
-//it under the terms of the GNU Lesser General Public License as published
-//by the Free Software Foundation, either version 3 of the License, or
-//(at your option) any later version.
-//
-//Caelum is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//GNU Lesser General Public License for more details.
-//
-//You should have received a copy of the GNU Lesser General Public License
-//along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-vertex_program CaelumGroundFogVP cg
-{
-	source CaelumGroundFog.cg
-	entry_point GroundFog_vp
-	profiles vs_2_x arbvp1 vp30
-
-	default_params
-	{
-		param_named_auto worldViewProj worldviewproj_matrix
-		param_named_auto world world_matrix
-	}
-}
-
-fragment_program CaelumGroundFogFP cg
-{
-	source CaelumGroundFog.cg
-	entry_point GroundFog_fp
-	profiles ps_2_x arbfp1 fp30
-	
-	default_params
-	{
-		param_named_auto camPos camera_position
-		
-		// _auto seems wrong here, since the fog formulas are different than
-		// for standard exp fog.
-		param_named fogDensity float 0
-		param_named fogVerticalDecay float 0
-		param_named fogGroundLevel float 0
-		param_named fogColour float4 0 0 0 0
-	}
-}
-
-vertex_program CaelumGroundFogDomeVP cg
-{
-	source CaelumGroundFog.cg
-	entry_point GroundFogDome_vp
-	profiles vs_2_0 arbvp1
-	
-	default_params
-	{
-		param_named_auto worldViewProj worldviewproj_matrix
-	}
-}
-
-fragment_program CaelumGroundFogDomeFP cg
-{
-	source CaelumGroundFog.cg
-	entry_point GroundFogDome_fp
-	profiles ps_2_0 arbfp1
-
-	default_params
-	{
-		// Fog parameters.
-		param_named fogColour float4 0 0 0 0
-		param_named fogDensity float 0
-		param_named fogVerticalDecay float 0
-		param_named fogGroundLevel float 0
-		
-		// Send camera height. We can't send camera_position because
-		// the entity is always moved with the camera. Joy.
-		param_named cameraHeight float 0
-	}
-}
\ No newline at end of file
diff --git a/extern/caelum/resources/Haze.program b/extern/caelum/resources/Haze.program
deleted file mode 100755
index 6ddbfd87a0..0000000000
--- a/extern/caelum/resources/Haze.program
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-//This file is part of Caelum.
-//See http://www.ogre3d.org/wiki/index.php/Caelum 
-//
-//Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-//
-//Caelum is free software: you can redistribute it and/or modify
-//it under the terms of the GNU Lesser General Public License as published
-//by the Free Software Foundation, either version 3 of the License, or
-//(at your option) any later version.
-//
-//Caelum is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//GNU Lesser General Public License for more details.
-//
-//You should have received a copy of the GNU Lesser General Public License
-//along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-vertex_program CaelumHazeVP cg
-{
-	source CaelumSkyDome.cg
-	entry_point HazeVP
-	profiles vs_2_0 arbvp1 vp30
-
-	default_params
-	{
-		param_named_auto worldViewProj worldviewproj_matrix
-		param_named_auto camPos camera_position
-	}
-}
-
-fragment_program CaelumHazeFP cg
-{
-	source CaelumSkyDome.cg
-	entry_point HazeFP
-	profiles ps_2_0 arbfp1 fp30
-
-	default_params
-	{
-		param_named_auto fogColour fog_colour
-	}
-}
diff --git a/extern/caelum/resources/LayeredClouds.material b/extern/caelum/resources/LayeredClouds.material
deleted file mode 100755
index e0fff0be37..0000000000
--- a/extern/caelum/resources/LayeredClouds.material
+++ /dev/null
@@ -1,132 +0,0 @@
-//
-//This file is part of Caelum.
-//See http://www.ogre3d.org/wiki/index.php/Caelum 
-//
-//Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-//
-//Caelum is free software: you can redistribute it and/or modify
-//it under the terms of the GNU Lesser General Public License as published
-//by the Free Software Foundation, either version 3 of the License, or
-//(at your option) any later version.
-//
-//Caelum is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//GNU Lesser General Public License for more details.
-//
-//You should have received a copy of the GNU Lesser General Public License
-//along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-vertex_program CaelumLayeredCloudsVP cg
-{
-	source CaelumLayeredClouds.cg
-	entry_point LayeredClouds_vp
-	profiles vs_3_0 vp40 arbvp1
-	
-	default_params
-	{
-		param_named_auto worldViewProj worldviewproj_matrix
-		param_named_auto worldMatrix world_matrix 
-		param_named sunDirection float3 -1 -1 0
-	}
-}
-
-fragment_program CaelumLayeredCloudsFP cg
-{
-	source CaelumLayeredClouds.cg
-    entry_point LayeredClouds_fp
-    profiles ps_3_0 fp40 arbfp1
-
-    default_params
-    {
-        // Caelum sky properties
-        param_named sunLightColour float4 1 1 1 1
-        param_named sunSphereColour float4 1 1 1 1
-        param_named sunDirection float4 1 1 1 1
-        
-        // Fog colour; used as the base cloud colour.
-        param_named fogColour float4 0 0 0 0
-        
-        
-        // The inverse of the cloud forms scale
-        param_named cloudMassInvScale float 1.2
-        // The inverse of the cloud details scale
-        param_named cloudDetailInvScale float 4.8
-        
-        // Cloud mass offset
-        param_named cloudMassOffset float2 0 0
-        // Cloud details offset
-        param_named cloudDetailOffset float2 0.5 0.5
-        
-        // Blending factor between Cloud1 and Cloud2
-        param_named cloudMassBlend float 0.9
-        // Cloud detail weight.
-        param_named cloudDetailBlend float 0.5
-        
-        
-        // Cloud coverage, between 0 and 1
-        param_named cloudCoverageThreshold float 0.9
-
-        // Cloud sharpness. Lower values result in softer clouds.
-        param_named cloudSharpness float 4
-        
-        // Cloud thickness. Bigger values results in darker clouds.
-        param_named cloudThickness float 3
-        
-        param_named_auto camera_position camera_position    
-        param_named layerHeight float 0
-        
-        param_named cloudUVFactor float -1
-        param_named heightRedFactor float -1
-
-        param_named nearFadeDist float -1
-        param_named farFadeDist float -1
-        
-        param_named fadeDistMeasurementVector float3 0 1 1
-    }
-}
-
-material CaelumLayeredClouds
-{
-	technique
-	{
-		pass
-		{
-			lighting off
-			depth_check on                                     
-			depth_write off
-			scene_blend alpha_blend
-			fog_override true
-			cull_hardware none
-
-			vertex_program_ref CaelumLayeredCloudsVP
-			{
-			}
-			
-			fragment_program_ref CaelumLayeredCloudsFP
-			{
-			}
-
-			texture_unit Cloud1
-			{
-				texture noise1.dds
-                filtering trilinear
-                tex_coord_set 0
-			}
-			
-			texture_unit Cloud2
-			{
-				texture noise2.dds
-                filtering trilinear
-                tex_coord_set 1
-			}
-			
-			texture_unit Detail
-			{
-				texture noise4.dds
-                tex_coord_set 2
-			}
-		}
-	}
-}
diff --git a/extern/caelum/resources/MinimalCompositorVP.cg b/extern/caelum/resources/MinimalCompositorVP.cg
deleted file mode 100755
index dc0721c375..0000000000
--- a/extern/caelum/resources/MinimalCompositorVP.cg
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// This file is part of Caelum.
-// See http://www.ogre3d.org/wiki/index.php/Caelum 
-// 
-// Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-// 
-// Caelum is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Caelum is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public License
-// along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-// Fixed function does not always work.
-// This is a the minimal compositor VP required.
-void MinimalCompositorVP
-(
-    in float4 in_pos : POSITION,
-    
-    uniform float4x4 worldviewproj_matrix,
-    
-    out float2 out_uv0 : TEXCOORD0,
-    out float4 out_pos : POSITION
-)
-{
-    // Use standard transform.
-    out_pos = mul(worldviewproj_matrix, in_pos);
-
-    // Convert to image-space
-    in_pos.xy = sign(in_pos.xy);
-    out_uv0 = (float2(in_pos.x, -in_pos.y) + 1.0f) * 0.5f;    
-}
diff --git a/extern/caelum/resources/MinimalCompositorVP.program b/extern/caelum/resources/MinimalCompositorVP.program
deleted file mode 100755
index b17e7ac43a..0000000000
--- a/extern/caelum/resources/MinimalCompositorVP.program
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// This file is part of Caelum.
-// See http://www.ogre3d.org/wiki/index.php/Caelum 
-// 
-// Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-// 
-// Caelum is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Caelum is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public License
-// along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-vertex_program Caelum/MinimalCompositorVP cg
-{
-	source MinimalCompositorVP.cg
-	entry_point MinimalCompositorVP
-	profiles vs_1_1 arbvp1
-	
-	default_params
-	{
-		param_named_auto worldviewproj_matrix worldviewproj_matrix
-	}
-}
diff --git a/extern/caelum/resources/PointStarfield.material b/extern/caelum/resources/PointStarfield.material
deleted file mode 100755
index 62d39292b1..0000000000
--- a/extern/caelum/resources/PointStarfield.material
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-//This file is part of Caelum.
-//See http://www.ogre3d.org/wiki/index.php/Caelum 
-//
-//Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-//
-//Caelum is free software: you can redistribute it and/or modify
-//it under the terms of the GNU Lesser General Public License as published
-//by the Free Software Foundation, either version 3 of the License, or
-//(at your option) any later version.
-//
-//Caelum is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//GNU Lesser General Public License for more details.
-//
-//You should have received a copy of the GNU Lesser General Public License
-//along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-vertex_program Caelum/StarPointVP cg
-{
-	source CaelumPointStarfield.cg
-	entry_point StarPointVP
-	profiles vs_2_0 arbvp1 vp30
-
-	default_params
-	{
-	    param_named_auto worldviewproj_matrix worldviewproj_matrix
-        param_named_auto render_target_flipping render_target_flipping
-	    
-	    // Default parameters only here to quiet ogre.
-	    param_named mag_scale float -1
-        param_named mag0_size float -1
-        param_named min_size float -1
-        param_named max_size float -1 
-        param_named aspect_ratio float -1
-	}
-}
-
-fragment_program Caelum/StarPointFP cg
-{
-	source CaelumPointStarfield.cg
-	entry_point StarPointFP
-	profiles ps_2_0 arbfp1 fp30
-
-	default_params
-	{
-	}
-}
-
-material Caelum/StarPoint
-{
-	receive_shadows off
-	
-	technique
-	{
-		pass
-		{
-			depth_check off
-			depth_write off
-
-            vertex_program_ref Caelum/StarPointVP
-            {
-            }
-            			
-            fragment_program_ref Caelum/StarPointFP
-            {
-            }
-            
-            scene_blend alpha_blend
-            
-            // Works with default culling:
-            cull_hardware clockwise
-            
-            // Override Direct3D shader fog.
-            fog_override true none
-        }
-	}
-}
diff --git a/extern/caelum/resources/Precipitation.cg b/extern/caelum/resources/Precipitation.cg
deleted file mode 100755
index 1add739af3..0000000000
--- a/extern/caelum/resources/Precipitation.cg
+++ /dev/null
@@ -1,102 +0,0 @@
-//
-// This file is part of Caelum.
-// See http://www.ogre3d.org/wiki/index.php/Caelum 
-// 
-// Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-// 
-// Caelum is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Caelum is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public License
-// along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-sampler scene: register(s0);
-sampler samplerPrec: register(s1);
-
-uniform float intensity;
-uniform float4 ambient_light_colour;
-
-// - - corner
-uniform float4 corner1;
-// + - corner
-uniform float4 corner2;
-// - + corner
-uniform float4 corner3;
-// + + corner
-uniform float4 corner4;
-
-// The x and y coordinal deviations for all 3 layers of precipitation
-uniform float4 deltaX;
-uniform float4 deltaY;
-
-uniform float4 precColor;
-
-// Cartesian to cylindrical coordinates
-float2 CylindricalCoordinates(float4 dir) {
-	float R = 0.5;
-	float2 res;
-	//cubical root is used to counteract top/bottom circle effect
-	dir *= R / pow(length(dir.xz), 0.33);
-	res.y = -dir.y;
-	res.x = -atan2(dir.z, dir.x);
-	return res;
-}
-
-// Returns alpha value of a precipitation
-// view_direction is the direction vector resulting from the eye direction,wind direction and possibly other factors
-float Precipitation
-	(
-		float2 cCoords,
-		float intensity,
-		float2 delta
-	) {
-	cCoords -= delta;
-	float4 raincol = tex2D(samplerPrec, cCoords);
-	return (raincol.g<intensity) ? (raincol.r) : 1;
-}
-
-//main entry point
-void MainFP
-(
-	in float2 scr_pos : TEXCOORD0,
-	out float4 out_colour : COLOR	
-) {
-	float4 eye = lerp (
-		lerp(corner1, corner3, scr_pos.y),
-		lerp(corner2, corner4, scr_pos.y),
-		scr_pos.x ) ;
-	
-	float4 scenecol = tex2D(scene, scr_pos);
-	float2 cCoords = CylindricalCoordinates(eye);
-	float prec1 = Precipitation(cCoords, intensity/4, float2(deltaX.x,deltaY.x));
-	float prec2 = Precipitation(cCoords, intensity/4, float2(deltaX.y,deltaY.y));
-	float prec3 = Precipitation(cCoords, intensity/4, float2(deltaX.z,deltaY.z));
-	float prec = min( min (prec1, prec2), prec3);
-	out_colour = lerp(precColor, scenecol, prec );	
-}
-
-void MainVP
-(
-    in float4 in_pos : POSITION,
-    
-    uniform float4x4 worldviewproj_matrix,
-    
-    out float2 out_uv0 : TEXCOORD0,
-    out float4 out_pos : POSITION
-)
-{
-    // Use standard transform.
-    out_pos = mul(worldviewproj_matrix, in_pos);
-
-    // Convert to image-space
-    in_pos.xy = sign(in_pos.xy);
-    out_uv0 = (float2(in_pos.x, -in_pos.y) + 1.0f) * 0.5f;    
-}
diff --git a/extern/caelum/resources/Precipitation.compositor b/extern/caelum/resources/Precipitation.compositor
deleted file mode 100755
index c22165d8a0..0000000000
--- a/extern/caelum/resources/Precipitation.compositor
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// This file is part of Caelum.
-// See http://www.ogre3d.org/wiki/index.php/Caelum 
-// 
-// Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-// 
-// Caelum is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Caelum is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public License
-// along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-compositor Caelum/PrecipitationCompositor
-{
-    technique
-    {
-        texture rt0 target_width target_height PF_A8R8G8B8
-
-        target rt0
-        {
-            input previous
-        }
-
-        target_output
-        {
-            input none
-            
-            pass render_quad
-            {
-                // Renders a fullscreen quad with a material
-                material Caelum/PrecipitationMaterial
-                input 0 rt0
-            }
-        }
-    }
-}
diff --git a/extern/caelum/resources/Precipitation.material b/extern/caelum/resources/Precipitation.material
deleted file mode 100755
index 227f3c8fb4..0000000000
--- a/extern/caelum/resources/Precipitation.material
+++ /dev/null
@@ -1,69 +0,0 @@
-//
-// This file is part of Caelum.
-// See http://www.ogre3d.org/wiki/index.php/Caelum 
-// 
-// Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-// 
-// Caelum is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-// 
-// Caelum is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU Lesser General Public License for more details.
-// 
-// You should have received a copy of the GNU Lesser General Public License
-// along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-fragment_program Caelum/PrecipitationFP cg
-{
-	source Precipitation.cg
-	entry_point MainFP
-	profiles ps_3_0 fp40 arbfp1
-	
-	default_params
-	{
-	}
-}
-
-vertex_program Caelum/PrecipitationVP cg
-{
-	source Precipitation.cg
-	entry_point MainVP
-	profiles vs_3_0 vp40 arbvp1
-	
-	default_params
-	{
-		param_named_auto worldviewproj_matrix worldviewproj_matrix
-	}
-}
-
-material Caelum/PrecipitationMaterial
-{
-	technique Default
-	{
-		pass Main
-		{			
-			vertex_program_ref Caelum/PrecipitationVP
-			{
-			}
-			
-			fragment_program_ref Caelum/PrecipitationFP
-			{
-			}
-			
-			texture_unit Scene
-			{			
-			}
-			
-			texture_unit Precipitation
-			{
-                texture precipitation_drizzle.png
-                filtering trilinear
-			}
-		}
-	}
-}
diff --git a/extern/caelum/resources/SkyDome.material b/extern/caelum/resources/SkyDome.material
deleted file mode 100755
index 23bb96d387..0000000000
--- a/extern/caelum/resources/SkyDome.material
+++ /dev/null
@@ -1,119 +0,0 @@
-//
-//This file is part of Caelum.
-//See http://www.ogre3d.org/wiki/index.php/Caelum 
-//
-//Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-//
-//Caelum is free software: you can redistribute it and/or modify
-//it under the terms of the GNU Lesser General Public License as published
-//by the Free Software Foundation, either version 3 of the License, or
-//(at your option) any later version.
-//
-//Caelum is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//GNU Lesser General Public License for more details.
-//
-//You should have received a copy of the GNU Lesser General Public License
-//along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-fragment_program CaelumSkyDomeFP cg
-{
-	source CaelumSkyDome.cg
-	entry_point SkyDomeFP
-	compile_arguments -DHAZE
-	profiles ps_2_0 arbfp1
-
-	default_params
-	{
-		// Caelum sky properties
-		param_named offset float 0
-		param_named hazeColour float4 0 0 0 0
-	}
-}
-
-fragment_program CaelumSkyDomeFP_NoHaze cg
-{
-	source CaelumSkyDome.cg
-	entry_point SkyDomeFP
-	profiles ps_2_0 arbfp1
-
-	default_params
-	{
-		// Caelum sky properties
-		param_named offset float 0
-	}
-}
-
-vertex_program CaelumSkyDomeVP cg
-{
-	source CaelumSkyDome.cg
-	entry_point SkyDomeVP
-	profiles vs_2_0 arbvp1
-	
-	default_params
-	{
-		param_named_auto worldViewProj worldviewproj_matrix
-		param_named sunDirection float3 1 0 0
-	}
-}
-
-material CaelumSkyDomeMaterial
-{
-	receive_shadows off
-	
-	technique
-	{
-		pass
-		{
-			lighting off
-			depth_check off
-			depth_write off
-			scene_blend alpha_blend
-			fog_override true none
-			
-			vertex_program_ref CaelumSkyDomeVP
-			{
-			}
-			
-			fragment_program_ref CaelumSkyDomeFP
-			{
-			}
-
-			texture_unit
-			{
-				texture EarthClearSky2.png 0
-				tex_address_mode clamp
-				tex_coord_set 0
-			}
-
-			texture_unit
-			{
-				texture AtmosphereDepth.png 1d
-				tex_address_mode clamp
-				tex_coord_set 1
-			}
-		}
-	}
-
-	technique
-	{
-		pass
-		{
-			lighting off
-			depth_check off
-			depth_write off
-			scene_blend alpha_blend
-			fog_override true
-			
-			texture_unit
-			{
-				texture EarthClearSky2.png 0
-				tex_address_mode clamp
-				tex_coord_set 0
-			}
-		}
-	}
-}
-
diff --git a/extern/caelum/resources/Starfield.jpg b/extern/caelum/resources/Starfield.jpg
deleted file mode 100755
index 597072a74e..0000000000
Binary files a/extern/caelum/resources/Starfield.jpg and /dev/null differ
diff --git a/extern/caelum/resources/Starfield.material b/extern/caelum/resources/Starfield.material
deleted file mode 100755
index 71cb43ce97..0000000000
--- a/extern/caelum/resources/Starfield.material
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-//This file is part of Caelum.
-//See http://www.ogre3d.org/wiki/index.php/Caelum 
-//
-//Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-//
-//Caelum is free software: you can redistribute it and/or modify
-//it under the terms of the GNU Lesser General Public License as published
-//by the Free Software Foundation, either version 3 of the License, or
-//(at your option) any later version.
-//
-//Caelum is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//GNU Lesser General Public License for more details.
-//
-//You should have received a copy of the GNU Lesser General Public License
-//along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-material CaelumStarfieldMaterial
-{
-	receive_shadows off
-	
-	technique
-	{
-		pass
-		{
-			depth_check off
-			depth_write off
-			lighting off
-			fog_override true
-			
-			texture_unit
-			{
-				texture Starfield.jpg 0
-				tex_address_mode wrap
-			}
-		}
-	}
-}
-
diff --git a/extern/caelum/resources/Sun.material b/extern/caelum/resources/Sun.material
deleted file mode 100755
index 124e8ece36..0000000000
--- a/extern/caelum/resources/Sun.material
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-//This file is part of Caelum.
-//See http://www.ogre3d.org/wiki/index.php/Caelum 
-//
-//Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-//
-//Caelum is free software: you can redistribute it and/or modify
-//it under the terms of the GNU Lesser General Public License as published
-//by the Free Software Foundation, either version 3 of the License, or
-//(at your option) any later version.
-//
-//Caelum is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//GNU Lesser General Public License for more details.
-//
-//You should have received a copy of the GNU Lesser General Public License
-//along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-material CaelumSphereSun
-{
-    technique Defaulto
-    {
-        pass Main
-        {
-            depth_check off
-            depth_write off
-            fog_override true none
-            ambient 0 0 0
-            diffuse 0 0 0
-        }
-    }
-}
-
-material CaelumSpriteSun
-{
-    receive_shadows off
-    technique Default
-    {
-        pass Main
-        {
-            lighting off
-            depth_check off
-            depth_write off
-            fog_override true none
-            ambient 0 0 0
-            diffuse 0 0 0
-            scene_blend src_colour one_minus_src_colour
-            alpha_rejection greater_equal 128
-            emissive vertexcolour
-            texture_unit Texture0
-            {
-                texture sun_disc.png 2d 0
-            }
-        }
-    }
-}
\ No newline at end of file
diff --git a/extern/caelum/resources/SunGradient.png b/extern/caelum/resources/SunGradient.png
deleted file mode 100755
index 7cda1fe810..0000000000
Binary files a/extern/caelum/resources/SunGradient.png and /dev/null differ
diff --git a/extern/caelum/resources/moon.material b/extern/caelum/resources/moon.material
deleted file mode 100755
index 6de4958eb9..0000000000
--- a/extern/caelum/resources/moon.material
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-//This file is part of Caelum.
-//See http://www.ogre3d.org/wiki/index.php/Caelum 
-//
-//Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-//
-//Caelum is free software: you can redistribute it and/or modify
-//it under the terms of the GNU Lesser General Public License as published
-//by the Free Software Foundation, either version 3 of the License, or
-//(at your option) any later version.
-//
-//Caelum is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//GNU Lesser General Public License for more details.
-//
-//You should have received a copy of the GNU Lesser General Public License
-//along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-//
-
-fragment_program Caelum/PhaseMoonFP cg
-{
-	source CaelumPhaseMoon.cg
-	entry_point PhaseMoonFP
-	profiles ps_2_0 arbfp1 fp30
-
-	default_params
-	{
-		param_named phase float 0.3
-	}
-}
-
-material Caelum/FullMoon
-{
-    receive_shadows off
-    technique Default
-    {
-        pass Main
-        {
-            lighting off
-            depth_check off
-            depth_write off
-            fog_override true none
-            ambient 0 0 0
-            diffuse 0 0 0
-            scene_blend alpha_blend 
-            emissive vertexcolour
-
-            texture_unit Texture0
-            {
-                texture moon_disc.dds 2d
-            }
-        }
-    }
-}
-
-material Caelum/PhaseMoon
-{
-    receive_shadows off
-    technique Default
-    {
-        pass Main
-        {
-            lighting off
-            depth_check off
-            depth_write off
-            fog_override true none
-            ambient 0 0 0
-            diffuse 0 0 0
-            scene_blend alpha_blend
-
-            texture_unit MoonDisc
-            {
-                texture moon_disc.dds
-            }
-            
-            fragment_program_ref Caelum/PhaseMoonFP
-            {
-            }
-        }
-    }
-}
-
-material Caelum/MoonBackground
-{
-    receive_shadows off
-    technique Default
-    {
-        pass Main
-        {
-            // Used fixed function lighting to return black.
-            lighting off
-            
-            depth_check off
-            depth_write off
-            fog_override true none
-            scene_blend alpha_blend
-
-            texture_unit MoonDisc
-            {
-                texture moon_disc.dds
-                colour_op_ex source1 src_manual src_diffuse 0 0 0 0
-            }
-        }
-    }
-}
-
diff --git a/extern/caelum/resources/moon_disc.dds b/extern/caelum/resources/moon_disc.dds
deleted file mode 100755
index b0f8d45409..0000000000
Binary files a/extern/caelum/resources/moon_disc.dds and /dev/null differ
diff --git a/extern/caelum/resources/noise1.dds b/extern/caelum/resources/noise1.dds
deleted file mode 100755
index 5b2dee849a..0000000000
Binary files a/extern/caelum/resources/noise1.dds and /dev/null differ
diff --git a/extern/caelum/resources/noise2.dds b/extern/caelum/resources/noise2.dds
deleted file mode 100755
index 918cc58793..0000000000
Binary files a/extern/caelum/resources/noise2.dds and /dev/null differ
diff --git a/extern/caelum/resources/noise3.dds b/extern/caelum/resources/noise3.dds
deleted file mode 100755
index bc4b3dce55..0000000000
Binary files a/extern/caelum/resources/noise3.dds and /dev/null differ
diff --git a/extern/caelum/resources/noise4.dds b/extern/caelum/resources/noise4.dds
deleted file mode 100755
index a0fb7fd810..0000000000
Binary files a/extern/caelum/resources/noise4.dds and /dev/null differ
diff --git a/extern/caelum/resources/precipitation_drizzle.png b/extern/caelum/resources/precipitation_drizzle.png
deleted file mode 100755
index 943f8ed601..0000000000
Binary files a/extern/caelum/resources/precipitation_drizzle.png and /dev/null differ
diff --git a/extern/caelum/resources/precipitation_hail.png b/extern/caelum/resources/precipitation_hail.png
deleted file mode 100755
index 839a57c686..0000000000
Binary files a/extern/caelum/resources/precipitation_hail.png and /dev/null differ
diff --git a/extern/caelum/resources/precipitation_icecrystals.png b/extern/caelum/resources/precipitation_icecrystals.png
deleted file mode 100755
index a67cf98e13..0000000000
Binary files a/extern/caelum/resources/precipitation_icecrystals.png and /dev/null differ
diff --git a/extern/caelum/resources/precipitation_icepellets.png b/extern/caelum/resources/precipitation_icepellets.png
deleted file mode 100755
index d0c8d977fe..0000000000
Binary files a/extern/caelum/resources/precipitation_icepellets.png and /dev/null differ
diff --git a/extern/caelum/resources/precipitation_rain.png b/extern/caelum/resources/precipitation_rain.png
deleted file mode 100755
index 561b285239..0000000000
Binary files a/extern/caelum/resources/precipitation_rain.png and /dev/null differ
diff --git a/extern/caelum/resources/precipitation_smallhail.png b/extern/caelum/resources/precipitation_smallhail.png
deleted file mode 100755
index 7197ae0388..0000000000
Binary files a/extern/caelum/resources/precipitation_smallhail.png and /dev/null differ
diff --git a/extern/caelum/resources/precipitation_snow.png b/extern/caelum/resources/precipitation_snow.png
deleted file mode 100755
index 4106d62980..0000000000
Binary files a/extern/caelum/resources/precipitation_snow.png and /dev/null differ
diff --git a/extern/caelum/resources/precipitation_snowgrains.png b/extern/caelum/resources/precipitation_snowgrains.png
deleted file mode 100755
index 18518661e1..0000000000
Binary files a/extern/caelum/resources/precipitation_snowgrains.png and /dev/null differ
diff --git a/extern/caelum/resources/sphere.mesh b/extern/caelum/resources/sphere.mesh
deleted file mode 100755
index 286317e0a8..0000000000
Binary files a/extern/caelum/resources/sphere.mesh and /dev/null differ
diff --git a/extern/caelum/resources/sun_disc.png b/extern/caelum/resources/sun_disc.png
deleted file mode 100755
index 858537caea..0000000000
Binary files a/extern/caelum/resources/sun_disc.png and /dev/null differ
diff --git a/extern/caelum/src/Astronomy.cpp b/extern/caelum/src/Astronomy.cpp
deleted file mode 100644
index 315b756fb2..0000000000
--- a/extern/caelum/src/Astronomy.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "Astronomy.h"
-
-namespace Caelum
-{
-    const LongReal Astronomy::PI = 3.1415926535897932384626433832795029L;
-    
-    const LongReal Astronomy::J2000 = 2451545.0;
-
-    LongReal Astronomy::radToDeg (LongReal value)
-    {
-        return value * 180 / PI;
-    }
-
-    LongReal Astronomy::degToRad (LongReal value)
-    {
-        return value * PI / 180;
-    }
-
-    LongReal Astronomy::sinDeg (LongReal x) {
-        return std::sin (degToRad (x));
-    }
-
-    LongReal Astronomy::cosDeg (LongReal x) {
-        return std::cos (degToRad (x));
-    }
-
-    LongReal Astronomy::atan2Deg (LongReal y, LongReal x) {
-        return radToDeg(std::atan2 (y, x));
-    }
-
-    LongReal Astronomy::normalizeDegrees (LongReal value)
-    {
-        value = fmod (value, 360);
-        if (value < LongReal (0)) {
-            value += LongReal (360);
-        }
-        return value;
-    }
-
-	void Astronomy::convertEclipticToEquatorialRad (
-            LongReal lon, LongReal lat,
-            LongReal &rasc, LongReal &decl)
-	{
-		double ecl = Astronomy::degToRad(23.439281);
-
-		double x = cos(lon) * cos(lat);
-		double y = cos(ecl) * sin(lon) * cos(lat) - sin(ecl) * sin(lat);
-		double z = sin(ecl) * sin(lon) * cos(lat) + cos(ecl) * sin(lat);
-
-        double r = sqrt(x * x + y * y);
-        rasc = atan2(y, x);
-        decl = atan2(z, r);
-	} 
-
-    void Astronomy::convertRectangularToSpherical (
-            LongReal x, LongReal y, LongReal z,
-            LongReal &rasc, LongReal &decl, LongReal &dist)
-    {
-        dist = sqrt (x * x + y * y + z * z);
-        rasc = atan2Deg (y, x);
-        decl = atan2Deg (z, sqrt (x * x + y * y));
-    }
-
-    void Astronomy::convertSphericalToRectangular (
-            LongReal rasc, LongReal decl, LongReal dist,
-            LongReal &x, LongReal &y, LongReal &z)
-    {
-        x = dist * cosDeg (rasc) * cosDeg (decl);
-        y = dist * sinDeg (rasc) * cosDeg (decl);
-        z = dist * sinDeg (decl);
-    }
-
-	void Astronomy::convertEquatorialToHorizontal (
-            LongReal jday,
-            LongReal longitude,   LongReal latitude,
-            LongReal rasc,        LongReal decl,
-            LongReal &azimuth,    LongReal &altitude)
-    {
-        LongReal d = jday - 2451543.5;
-        LongReal w = LongReal (282.9404 + 4.70935E-5 * d);
-        LongReal M = LongReal (356.0470 + 0.9856002585 * d);
-        // Sun's mean longitude
-        LongReal L = w + M;
-        // Universal time of day in degrees.
-        LongReal UT = LongReal(fmod(d, 1) * 360);
-        LongReal hourAngle = longitude + L + LongReal (180) + UT - rasc;
-
-        LongReal x = cosDeg (hourAngle) * cosDeg (decl);
-        LongReal y = sinDeg (hourAngle) * cosDeg (decl);
-        LongReal z = sinDeg (decl);
-
-        LongReal xhor = x * sinDeg (latitude) - z * cosDeg (latitude);
-        LongReal yhor = y;
-        LongReal zhor = x * cosDeg (latitude) + z * sinDeg (latitude);
-
-        azimuth = atan2Deg (yhor, xhor) + LongReal (180);
-        altitude = atan2Deg (zhor, sqrt (xhor * xhor + yhor * yhor));
-    }
-
-    void Astronomy::getHorizontalSunPosition (
-            LongReal jday,
-            LongReal longitude, LongReal latitude,
-            LongReal &azimuth, LongReal &altitude)
-    {
-        // 2451544.5 == Astronomy::getJulianDayFromGregorianDateTime(2000, 1, 1, 0, 0, 0));
-        // 2451543.5 == Astronomy::getJulianDayFromGregorianDateTime(1999, 12, 31, 0, 0, 0));
-        LongReal d = jday - 2451543.5;
-
-        // Sun's Orbital elements:
-        // argument of perihelion
-        LongReal w = LongReal (282.9404 + 4.70935E-5 * d);
-        // eccentricity (0=circle, 0-1=ellipse, 1=parabola)
-        LongReal e = 0.016709 - 1.151E-9 * d;
-        // mean anomaly (0 at perihelion; increases uniformly with time)
-        LongReal M = LongReal(356.0470 + 0.9856002585 * d);
-        // Obliquity of the ecliptic.
-        //LongReal oblecl = LongReal (23.4393 - 3.563E-7 * d);
-
-        // Eccentric anomaly
-        LongReal E = M + radToDeg(e * sinDeg (M) * (1 + e * cosDeg (M)));
-
-        // Sun's Distance(R) and true longitude(L)
-        LongReal xv = cosDeg (E) - e;
-        LongReal yv = sinDeg (E) * sqrt (1 - e * e);
-        //LongReal r = sqrt (xv * xv + yv * yv);
-        LongReal lon = atan2Deg (yv, xv) + w;
-        LongReal lat = 0;
-
-		LongReal lambda = degToRad(lon);
-		LongReal beta = degToRad(lat);
-        LongReal rasc, decl;
-		convertEclipticToEquatorialRad (lambda, beta, rasc, decl);
-		rasc = radToDeg(rasc);
-		decl = radToDeg(decl);
-
-        // Horizontal spherical.
-        Astronomy::convertEquatorialToHorizontal (
-                jday, longitude, latitude, rasc, decl, azimuth, altitude);
-    }
-
-    void Astronomy::getHorizontalSunPosition (
-            LongReal jday,
-            Ogre::Degree longitude, Ogre::Degree latitude,
-            Ogre::Degree &azimuth, Ogre::Degree &altitude)
-    {
-        LongReal az, al;
-        getHorizontalSunPosition(jday, longitude.valueDegrees (), latitude.valueDegrees (), az, al);
-        azimuth = Ogre::Degree(az);                
-        altitude = Ogre::Degree(al);                
-    }
-
-	void Astronomy::getEclipticMoonPositionRad (
-            LongReal jday,
-            LongReal &lon, LongReal &lat)
-	{
-        // Julian centuries since January 1, 2000
-		double T = (jday - 2451545.0L) / 36525.0L; 
-		double lprim = 3.8104L + 8399.7091L * T;
-		double mprim = 2.3554L + 8328.6911L * T;
-		double m = 6.2300L + 648.3019L * T;
-		double d = 5.1985L + 7771.3772L * T;
-		double f = 1.6280L + 8433.4663L * T;
-		lon = lprim
-                + 0.1098L * sin(mprim)
-                + 0.0222L * sin(2.0L * d - mprim)
-                + 0.0115L * sin(2.0L * d)
-				+ 0.0037L * sin(2.0L * mprim)
-                - 0.0032L * sin(m)
-                - 0.0020L * sin(2.0L * f)
-                + 0.0010L * sin(2.0L * d - 2.0L * mprim)
-				+ 0.0010L * sin(2.0L * d - m - mprim)
-                + 0.0009L * sin(2.0L * d + mprim)
-                + 0.0008L * sin(2.0L * d - m)
-				+ 0.0007L * sin(mprim - m)
-                - 0.0006L * sin(d)
-                - 0.0005L * sin(m + mprim);
-		lat =
-                + 0.0895L * sin(f)
-                + 0.0049L * sin(mprim + f)
-                + 0.0048L * sin(mprim - f)
-                + 0.0030L * sin(2.0L * d - f)
-                + 0.0010L * sin(2.0L * d + f - mprim)
-                + 0.0008  * sin(2.0L * d - f - mprim)
-                + 0.0006L * sin(2.0L * d + f);
-	}
-
-    void Astronomy::getHorizontalMoonPosition (
-            LongReal jday,
-            LongReal longitude, LongReal latitude,
-            LongReal &azimuth, LongReal &altitude)
-    {
-        // Ecliptic spherical
-		LongReal lonecl, latecl;
-		Astronomy::getEclipticMoonPositionRad (jday, lonecl, latecl);
-
-		// Equatorial spherical
-        LongReal rasc, decl; 
-		Astronomy::convertEclipticToEquatorialRad (lonecl, latecl, rasc, decl);
-
-		// Radians to degrees (all angles are in radians up to this point)
-        rasc = radToDeg(rasc);
-		decl = radToDeg(decl);
-
-		// Equatorial to horizontal
-        Astronomy::convertEquatorialToHorizontal (
-                jday, longitude, latitude, rasc, decl, azimuth, altitude);
-    }
-
-    void Astronomy::getHorizontalMoonPosition (
-            LongReal jday,
-            Ogre::Degree longitude, Ogre::Degree latitude,
-            Ogre::Degree &azimuth, Ogre::Degree &altitude)
-    {
-        LongReal az, al;
-        getHorizontalMoonPosition(jday, longitude.valueDegrees (), latitude.valueDegrees (), az, al);
-        azimuth = Ogre::Degree(az);                
-        altitude = Ogre::Degree(al);  
-    }
-
-    int Astronomy::getJulianDayFromGregorianDate(
-            int year, int month, int day)
-    {
-        // Formulas from http://en.wikipedia.org/wiki/Julian_day
-        // These are all integer divisions, but I'm not sure it works
-        // correctly for negative values.
-        int a = (14 - month) / 12;
-        int y = year + 4800 - a;
-        int m = month + 12 * a - 3;
-        return day + (153 * m + 2) / 5 + 365 * y + y / 4 - y / 100 + y / 400 - 32045;
-    }
-
-    LongReal Astronomy::getJulianDayFromGregorianDateTime(
-            int year, int month, int day,
-            int hour, int minute, LongReal second)
-    {
-        ScopedHighPrecissionFloatSwitch precissionSwitch;
-
-        int jdn = getJulianDayFromGregorianDate (year, month, day);
-        // These are NOT integer divisions.
-        LongReal jd = jdn + (hour - 12) / 24.0 + minute / 1440.0 + second / 86400.0;
-
-        return jd;
-    }
-
-    LongReal Astronomy::getJulianDayFromGregorianDateTime(
-            int year, int month, int day,
-            LongReal secondsFromMidnight)
-    {
-        int jdn = getJulianDayFromGregorianDate(year, month, day);
-        LongReal jd = jdn + secondsFromMidnight / 86400.0 - 0.5;
-        return jd;
-    }
-
-    void Astronomy::getGregorianDateFromJulianDay(
-            int julianDay, int &year, int &month, int &day)
-    {
-        // From http://en.wikipedia.org/wiki/Julian_day
-        int J = julianDay;
-        int j = J + 32044;
-        int g = j / 146097;
-        int dg = j % 146097;
-        int c = (dg / 36524 + 1) * 3 / 4;
-        int dc = dg - c * 36524;
-        int b = dc / 1461;
-        int db = dc % 1461;
-        int a = (db / 365 + 1) * 3 / 4;
-        int da = db - a * 365;
-        int y = g * 400 + c * 100 + b * 4 + a;
-        int m = (da * 5 + 308) / 153 - 2;
-        int d = da - (m + 4) * 153 / 5 + 122;
-        year = y - 4800 + (m + 2) / 12;
-        month = (m + 2) % 12 + 1;
-        day = d + 1;
-    }
-
-    void Astronomy::getGregorianDateTimeFromJulianDay(
-            LongReal julianDay, int &year, int &month, int &day,
-            int &hour, int &minute, LongReal &second)
-    {
-        // Integer julian days are at noon.
-        // static_cast<int)(floor( is more precise than Ogre::Math::IFloor.
-        // Yes, it does matter.
-        int ijd = static_cast<int>(floor(julianDay + 0.5));
-        getGregorianDateFromJulianDay(ijd, year, month, day);
-
-        LongReal s = (julianDay + 0.5 - ijd) * 86400.0;
-        hour = static_cast<int>(floor(s / 3600));
-        s -= hour * 3600;
-        minute = static_cast<int>(floor(s / 60));
-        s -= minute * 60;
-        second = s;
-    }
-
-    void Astronomy::getGregorianDateFromJulianDay(
-            LongReal julianDay, int &year, int &month, int &day)
-    {
-        int hour;
-        int minute;
-        LongReal second;
-        getGregorianDateTimeFromJulianDay(julianDay, year, month, day, hour, minute, second);
-    }
-
-#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && (OGRE_COMPILER == OGRE_COMPILER_MSVC) && (OGRE_ARCH_TYPE != OGRE_ARCHITECTURE_64)
-    int Astronomy::enterHighPrecissionFloatingPointMode ()
-    {
-        int oldMode = ::_controlfp (0, 0);
-        ::_controlfp (_PC_64, _MCW_PC);
-        return oldMode;
-    }
-
-    void Astronomy::restoreFloatingPointMode (int oldMode)
-    {
-        ::_controlfp (oldMode, _MCW_PC);
-    }
-#else
-    int Astronomy::enterHighPrecissionFloatingPointMode ()
-    {
-        // Meaningless
-        return 0xC0FFEE;
-    }
-
-    void Astronomy::restoreFloatingPointMode (int oldMode)
-    {
-        // Useless check.
-        assert(oldMode == 0xC0FFEE);
-    }
-#endif
-}
diff --git a/extern/caelum/src/BrightStarCatalogue.cpp b/extern/caelum/src/BrightStarCatalogue.cpp
deleted file mode 100644
index 1a549084db..0000000000
--- a/extern/caelum/src/BrightStarCatalogue.cpp
+++ /dev/null
@@ -1,9140 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "PointStarfield.h"
-
-// Data from http://heasarc.gsfc.nasa.gov/W3Browse/star-catalog/bsc5p.html
-// Converted using the following MSVS regexps:
-// ^\|0*{:d+} 0*{:d+} 0*{[0-9.]+}\|{[+\-]}0*{:d+} 0*{:d+} 0*{[0-9.]+}\|{.*}\|$
-// { \(2,1), \(2,2), \(5,3), \4\(2,5), \(2,6), \(4,7),\(5, 8) },
-const Caelum::BrightStarCatalogueEntry Caelum::BrightStarCatalogue[BrightStarCatalogueSize] = {
-    { 21,  8, 46.20, -88, 57, 23.0, 5.47 },
-    { 22, 45, 28.61, -88, 49,  5.9, 6.57 },
-    { 15, 28, 19.10, -88,  7, 59.2, 6.48 },
-    { 18, 54, 46.90, -87, 36, 20.9, 5.28 },
-    { 17, 15, 59.30, -87, 33, 59.0, 6.57 },
-    { 23, 28,  3.70, -87, 28, 55.9, 5.49 },
-    {  6, 46, 58.70, -87,  1, 30.0, 6.47 },
-    { 17,  0, 58.49, -86, 21, 51.8, 6.04 },
-    { 12, 25, 37.49, -86,  9,  2.2, 6.33 },
-    { 22, 31, 37.39, -85, 58,  1.9, 5.77 },
-    { 13, 40, 55.49, -85, 47, 10.0, 5.58 },
-    {  8, 56, 41.09, -85, 39, 47.2, 5.42 },
-    { 12,  2, 20.11, -85, 37, 54.1, 6.05 },
-    {  3, 42, 32.11, -85, 15, 43.9, 6.41 },
-    { 18,  1, 34.10, -85, 12, 52.9, 6.45 },
-    { 12, 54, 58.61, -85,  7, 23.9, 5.46 },
-    {  0, 13, 19.39, -84, 59, 39.1, 5.77 },
-    { 21, 32,  4.20, -84, 48, 36.0, 6.45 },
-    { 15, 11,  8.30, -84, 47, 15.0, 5.91 },
-    {  5, 30, 13.90, -84, 47,  6.0, 6.20 },
-    {  1, 37, 28.01, -84, 46, 10.9, 5.69 },
-    { 10, 59, 13.80, -84, 35, 38.0, 6.19 },
-    { 15, 43, 16.80, -84, 27, 55.1, 5.57 },
-    { 14, 26, 54.89, -83, 40,  4.1, 4.32 },
-    { 18, 51, 57.89, -83, 18, 59.0, 7.16 },
-    { 20, 24, 54.41, -83, 18, 38.2, 6.17 },
-    { 16, 45, 53.59, -83, 14, 20.0, 6.57 },
-    { 15,  1, 50.81, -83, 13, 40.1, 5.65 },
-    { 11, 41,  1.20, -83,  6,   .0, 6.33 },
-    { 15,  4, 46.70, -83,  2, 17.9, 5.65 },
-    {  1, 37, 55.61, -82, 58, 30.0, 5.87 },
-    {  4, 22, 50.90, -82, 53, 57.1, 6.76 },
-    { 14, 24, 23.30, -82, 50, 55.0, 6.42 },
-    { 21, 50, 54.31, -82, 43,  9.1, 5.29 },
-    { 21, 33, 54.41, -82, 40, 59.2, 6.38 },
-    { 13, 55, 38.71, -82, 39, 58.0, 5.95 },
-    {  4, 58, 50.90, -82, 28, 14.2, 5.85 },
-    {  0, 10,  2.09, -82, 13, 26.0, 5.28 },
-    { 10,  0, 43.70, -82, 12, 52.9, 5.52 },
-    { 23, 57, 32.71, -82, 10, 12.0, 5.73 },
-    { 23, 52,  6.41, -82,  1,  8.0, 5.11 },
-    { 10, 31, 51.00, -81, 55, 16.0, 7.07 },
-    { 18, 42, 14.09, -81, 48, 28.1, 6.27 },
-    {  4, 20, 57.89, -81, 34, 48.0, 5.79 },
-    { 10,  4,  7.61, -81, 33, 56.9, 6.60 },
-    { 10, 59, 12.91, -81, 33, 22.0, 6.71 },
-    {  5, 12, 25.70, -81, 32, 30.1, 6.51 },
-    { 18,  5, 26.69, -81, 29, 11.0, 6.35 },
-    { 22, 46,  3.31, -81, 22, 54.1, 4.15 },
-    { 19, 56,  1.51, -81, 20, 58.9, 6.39 },
-    { 20, 38, 18.60, -81, 17, 20.0, 5.91 },
-    { 14, 18, 13.80, -81,  0, 28.1, 4.91 },
-    { 20, 33, 17.50, -80, 57, 54.0, 5.77 },
-    {  9, 33, 53.21, -80, 56, 29.0, 5.11 },
-    {  8, 24, 19.80, -80, 54, 51.1, 5.69 },
-    { 23, 12, 12.00, -80, 54, 46.1, 6.41 },
-    { 17, 31, 27.29, -80, 51, 33.1, 5.88 },
-    {  6, 40,  2.71, -80, 48, 49.0, 5.64 },
-    {  9, 24,  9.10, -80, 47, 12.8, 5.36 },
-    { 10, 45, 46.80, -80, 32, 25.1, 4.45 },
-    { 10, 45, 15.70, -80, 28, 10.9, 5.47 },
-    {  5, 37,  9.79, -80, 28,  9.1, 5.65 },
-    { 22, 20,  1.51, -80, 26, 22.9, 5.10 },
-    { 18, 29, 19.49, -80, 13, 58.1, 5.95 },
-    {  4, 17, 59.09, -80, 12, 50.0, 5.69 },
-    {  1, 47, 46.51, -80, 10, 36.1, 6.06 },
-    { 22, 50, 22.90, -80,  7, 27.1, 5.35 },
-    { 14, 22, 22.70, -80,  6, 32.0, 5.06 },
-    { 21, 33, 20.59, -80,  2, 21.1, 6.47 },
-    { 10, 41, 51.29, -79, 46, 59.9, 5.97 },
-    { 11, 18, 34.30, -79, 40,  7.0, 6.35 },
-    { 10, 52, 27.50, -79, 33, 33.8, 6.33 },
-    {  8, 45, 55.20, -79, 30, 15.8, 5.79 },
-    { 23,  8, 23.71, -79, 28, 50.9, 6.12 },
-    { 23, 19,  8.11, -79, 28, 22.1, 6.33 },
-    { 21, 38, 56.21, -79, 26, 33.0, 6.18 },
-    {  6, 56, 34.39, -79, 25, 13.1, 5.45 },
-    {  5, 50, 16.70, -79, 21, 41.0, 5.47 },
-    { 12, 18, 20.69, -79, 18, 43.9, 4.26 },
-    { 11, 42, 55.39, -79, 18, 23.0, 6.39 },
-    {  1, 41, 21.31, -79,  8, 53.9, 6.33 },
-    {  2, 31, 40.51, -79,  6, 33.8, 5.28 },
-    {  7, 25, 37.99, -79,  5, 39.1, 5.53 },
-    {  8, 43, 12.41, -79,  4, 10.9, 6.05 },
-    { 14, 47, 51.60, -79,  2, 40.9, 3.83 },
-    {  3,  7, 31.99, -78, 59, 21.8, 5.57 },
-    {  8, 41, 19.51, -78, 57, 47.9, 5.47 },
-    { 16, 33, 27.00, -78, 53, 49.9, 3.89 },
-    {  5, 35, 36.31, -78, 49, 14.9, 6.05 },
-    { 23, 44, 40.70, -78, 47, 29.0, 5.75 },
-    {  0, 16, 49.01, -78, 46, 50.2, 6.77 },
-    { 22, 35, 26.40, -78, 46, 18.1, 6.15 },
-    { 16, 20, 20.81, -78, 41, 44.9, 4.68 },
-    { 16, 20, 26.81, -78, 40,  1.9, 5.27 },
-    { 10, 35, 28.10, -78, 36, 28.1, 4.11 },
-    { 14,  0, 32.81, -78, 35, 24.0, 6.09 },
-    { 12, 13, 55.70, -78, 34, 25.0, 6.35 },
-    {  1, 33, 39.19, -78, 30, 16.9, 6.11 },
-    { 13, 14, 17.21, -78, 26, 49.9, 5.85 },
-    {  3, 29, 58.80, -78, 21,  6.8, 5.70 },
-    {  1, 55, 50.50, -78, 20, 53.9, 6.16 },
-    {  3, 36, 30.00, -78, 19, 23.2, 6.29 },
-    {  5,  0, 13.20, -78, 18,  1.1, 6.29 },
-    { 11, 59, 37.30, -78, 13, 18.8, 4.91 },
-    { 15, 39, 18.29, -77, 55,  5.2, 6.18 },
-    { 18, 47, 49.39, -77, 52,  1.9, 6.39 },
-    { 14, 16, 54.89, -77, 39, 50.0, 6.47 },
-    { 22,  1, 52.10, -77, 39, 45.0, 6.41 },
-    {  4, 38, 21.70, -77, 39, 22.0, 6.05 },
-    {  7, 36,  4.20, -77, 38,  3.1, 6.18 },
-    { 11, 21, 57.10, -77, 36, 29.9, 6.43 },
-    { 13, 33, 14.81, -77, 34,  5.9, 6.48 },
-    { 16, 43,  4.61, -77, 31,  3.0, 4.24 },
-    { 22, 17, 50.50, -77, 30, 42.1, 5.51 },
-    {  8, 20, 38.50, -77, 29,  3.8, 4.35 },
-    {  0, 21, 28.61, -77, 25, 36.8, 5.97 },
-    { 21, 41, 28.49, -77, 23, 24.0, 3.76 },
-    {  3, 15, 57.60, -77, 23, 17.9, 5.52 },
-    { 23, 33, 19.49, -77, 23,  7.1, 5.81 },
-    {  0, 25, 45.10, -77, 15, 15.1, 2.80 },
-    { 15,  0, 11.81, -77,  9, 37.1, 5.93 },
-    {  0,  1, 35.71, -77,  3, 56.9, 4.78 },
-    { 22, 49, 40.90, -77,  3,  2.2, 6.73 },
-    { 21,  4, 43.01, -77,  1, 26.0, 5.15 },
-    {  8, 18, 31.61, -76, 55, 10.9, 4.07 },
-    { 23, 38, 24.10, -76, 52, 12.0, 6.00 },
-    { 14,  5, 19.80, -76, 47, 48.1, 5.50 },
-    {  9, 46, 20.59, -76, 46, 34.0, 5.45 },
-    { 14, 29, 36.79, -76, 43, 45.1, 6.07 },
-    {  9, 12, 12.31, -76, 39, 47.2, 6.14 },
-    { 14, 57, 52.90, -76, 39, 46.1, 5.34 },
-    { 12,  4, 46.51, -76, 31,  9.1, 5.04 },
-    {  5, 31, 52.90, -76, 20, 28.0, 5.19 },
-    { 10, 35, 24.79, -76, 18, 33.1, 6.30 },
-    { 21,  8, 47.90, -76, 12, 45.0, 6.58 },
-    { 20, 42,  2.90, -76, 10, 50.2, 6.00 },
-    { 17, 57, 41.81, -76, 10, 39.0, 6.07 },
-    { 22,  3,  3.79, -76,  7,  7.0, 5.95 },
-    { 22, 11, 55.30, -76,  6, 58.0, 6.15 },
-    { 15, 41, 54.60, -76,  4, 54.8, 5.95 },
-    {  0, 15, 55.20, -75, 54, 41.0, 6.49 },
-    { 11, 37, 15.60, -75, 53, 48.1, 5.65 },
-    { 18, 11, 15.70, -75, 53, 29.0, 5.86 },
-    { 22, 10, 42.50, -75, 52, 50.2, 6.55 },
-    { 13, 39, 11.90, -75, 41,  2.0, 6.34 },
-    { 12, 39, 14.50, -75, 22,  9.8, 6.49 },
-    { 12,  7, 49.80, -75, 22,   .8, 5.18 },
-    { 20, 41, 43.70, -75, 21,  2.2, 6.55 },
-    { 21, 18, 16.10, -75, 20, 48.1, 6.63 },
-    { 11, 19, 36.29, -75,  8, 33.0, 6.27 },
-    { 10, 57, 15.70, -75,  5, 58.9, 6.13 },
-    {  2, 50, 28.51, -75,  4,   .8, 4.75 },
-    { 18, 23, 36.10, -75,  2, 39.1, 5.47 },
-    { 14, 59, 55.99, -75,  1, 57.0, 6.20 },
-    { 22, 25, 51.00, -75,  0, 56.2, 6.04 },
-    {  4, 55, 11.21, -74, 56, 12.8, 5.47 },
-    {  0, 48, 35.40, -74, 55, 23.9, 5.07 },
-    {  9, 17, 25.39, -74, 53, 39.8, 5.29 },
-    { 13, 25,  7.10, -74, 53, 16.1, 5.05 },
-    { 14,  8, 27.10, -74, 51,  1.1, 6.02 },
-    {  6, 10, 14.40, -74, 45, 11.2, 5.09 },
-    {  9, 17, 27.41, -74, 44,  4.9, 5.86 },
-    { 13, 27, 18.29, -74, 41, 30.8, 6.63 },
-    { 17, 16, 35.59, -74, 31, 59.2, 6.25 },
-    { 10, 39, 16.61, -74, 29, 37.0, 6.07 },
-    {  7, 35, 21.79, -74, 16, 32.2, 7.26 },
-    {  7, 35, 21.70, -74, 16, 32.2, 7.16 },
-    {  3, 47, 14.30, -74, 14, 20.0, 3.24 },
-    { 12,  3, 44.30, -74, 12, 50.0, 6.44 },
-    { 10, 24, 23.71, -74,  1, 54.1, 4.00 },
-    { 10, 24, 44.30, -73, 58, 18.1, 6.19 },
-    { 18, 32, 55.30, -73, 57, 56.2, 5.89 },
-    {  5, 34, 44.69, -73, 44, 29.0, 5.78 },
-    { 18, 12, 34.49, -73, 40, 18.1, 5.85 },
-    {  2, 22, 52.30, -73, 38, 44.9, 5.01 },
-    { 23,  8, 35.69, -73, 35, 11.0, 6.15 },
-    { 15, 40, 21.19, -73, 26, 48.1, 5.65 },
-    {  8, 22,  4.39, -73, 24,   .0, 5.29 },
-    { 15, 31, 30.79, -73, 23, 21.8, 5.49 },
-    {  8, 32, 42.19, -73, 21, 24.1, 6.12 },
-    {  7, 59, 16.10, -73, 14, 40.9, 6.34 },
-    {  0, 10, 38.59, -73, 13, 27.8, 6.64 },
-    { 10, 31,  1.99, -73, 13, 18.1, 4.93 },
-    { 14, 53, 13.70, -73, 11, 24.0, 5.60 },
-    { 21,  9, 22.30, -73, 10, 23.2, 5.68 },
-    {  0, 38, 40.80, -73,  8, 13.9, 6.85 },
-    {  6, 43, 36.79, -73,  7,  5.2, 6.37 },
-    {  9, 31, 36.29, -73,  4, 50.9, 5.47 },
-    {  5,  6,  9.29, -73,  2, 16.1, 6.27 },
-    { 12, 32, 10.01, -73,  0,  6.1, 5.88 },
-    { 18, 49, 43.49, -72, 59, 40.9, 6.06 },
-    { 20,  0, 35.50, -72, 54, 38.2, 3.96 },
-    {  0,  4, 30.70, -72, 53, 52.1, 7.31 },
-    { 15, 12, 33.79, -72, 46, 13.1, 6.01 },
-    {  5, 47, 48.10, -72, 42,  7.9, 6.53 },
-    { 12, 16, 23.50, -72, 36, 52.9, 6.22 },
-    {  7, 41, 49.20, -72, 36, 22.0, 3.95 },
-    {  9,  5,  8.81, -72, 36, 10.1, 4.48 },
-    {  8, 49, 50.30, -72, 33,  2.9, 6.11 },
-    { 21, 11, 20.69, -72, 32, 39.1, 6.20 },
-    { 19, 49, 25.30, -72, 30, 11.9, 5.41 },
-    { 11, 28, 18.19, -72, 28, 27.8, 6.09 },
-    { 10, 44, 26.50, -72, 26, 38.0, 6.27 },
-    {  4, 53,  5.50, -72, 24, 27.0, 6.28 },
-    { 16,  5, 55.80, -72, 24,  2.9, 5.70 },
-    { 11, 24, 11.09, -72, 15, 24.1, 5.59 },
-    { 22, 24, 36.79, -72, 15, 20.2, 5.29 },
-    { 17, 44, 19.70, -72, 13, 14.9, 6.49 },
-    { 12, 56, 31.51, -72, 11,  7.1, 5.93 },
-    { 13, 22, 52.61, -72,  8, 48.1, 6.05 },
-    { 12, 32, 28.01, -72,  7, 59.2, 3.87 },
-    {  0, 24,  5.80, -72,  4, 52.0,      },
-    { 13, 19, 18.91, -72,  2,  8.2, 6.04 },
-    { 11, 20,  3.91, -71, 59, 39.8, 6.41 },
-    { 10, 30, 20.11, -71, 59, 35.2, 4.74 },
-    { 12, 49, 44.90, -71, 59, 11.0, 5.55 },
-    { 15,  7,  8.71, -71, 54, 19.1, 6.52 },
-    {  3,  2, 15.41, -71, 54,  9.0, 5.53 },
-    { 21, 25, 18.10, -71, 47, 57.8, 6.09 },
-    {  6, 40, 57.79, -71, 46, 32.2, 6.51 },
-    {  6, 15,  5.90, -71, 42, 10.1, 6.64 },
-    {  9, 27,  6.41, -71, 36,  7.9, 5.47 },
-    { 13,  2, 16.20, -71, 32, 56.0, 3.62 },
-    {  8, 19, 49.01, -71, 30, 54.0, 5.37 },
-    {  8, 20,   .70, -71, 30, 19.1, 5.65 },
-    { 12,  2, 28.61, -71, 29, 20.0, 6.42 },
-    { 13,  3,  5.21, -71, 28, 34.0, 6.03 },
-    {  0,  4, 41.30, -71, 26, 12.8, 5.59 },
-    { 11, 11, 29.50, -71, 26, 11.0, 6.35 },
-    { 18, 43,  2.11, -71, 25, 41.2, 4.01 },
-    {  9, 56,  9.70, -71, 23, 21.8, 6.35 },
-    {  5,  2, 43.01, -71, 18, 51.8, 5.31 },
-    {  0, 33, 23.30, -71, 15, 58.0, 6.13 },
-    { 21, 45, 28.80, -71,  0, 32.0, 6.01 },
-    { 16, 34, 19.30, -70, 59, 17.2, 5.50 },
-    {  6, 51, 27.00, -70, 57, 47.9, 5.40 },
-    {  4, 43,  3.91, -70, 55, 52.0, 5.54 },
-    { 11,  6, 49.90, -70, 52, 41.2, 5.57 },
-    { 10, 44, 19.39, -70, 51, 36.0, 6.26 },
-    { 10, 44, 32.09, -70, 51, 18.0, 6.46 },
-    { 13, 40,   .60, -70, 47, 17.9, 6.59 },
-    { 18, 14, 24.10, -70, 45,  5.0, 6.73 },
-    { 17, 12, 19.80, -70, 43, 16.0, 6.22 },
-    { 10, 53, 42.00, -70, 43, 13.1, 5.99 },
-    { 13, 25, 50.11, -70, 37, 39.0, 5.67 },
-    {  9,  5, 38.30, -70, 32, 20.0, 4.71 },
-    {  7,  8, 44.90, -70, 29, 56.0, 3.78 },
-    {  7,  8, 42.19, -70, 29, 49.9, 5.69 },
-    { 23, 44, 25.39, -70, 29, 25.1, 6.07 },
-    { 13, 38, 45.70, -70, 26, 42.0, 6.10 },
-    {  6, 44, 56.09, -70, 26,  2.0, 6.11 },
-    { 22, 25, 10.51, -70, 25, 54.1, 5.78 },
-    {  8, 39,  5.21, -70, 23, 12.8, 5.20 },
-    { 22, 49, 17.40, -70, 20, 52.1, 6.34 },
-    { 14, 10, 30.91, -70, 18, 20.2, 6.05 },
-    { 15, 40, 11.50, -70, 13, 40.1, 6.44 },
-    { 11, 49, 56.59, -70, 13, 32.9, 4.97 },
-    { 12, 12, 46.80, -70,  9,  6.8, 6.17 },
-    { 21, 13, 20.50, -70,  7, 35.0, 5.02 },
-    { 17, 22,  5.90, -70,  7, 23.9, 5.41 },
-    {  8, 27, 16.90, -70,  5, 35.9, 5.53 },
-    { 16, 28, 28.10, -70,  5,  3.8, 4.91 },
-    { 15, 14, 19.10, -70,  4, 45.8, 5.81 },
-    { 22, 54, 39.41, -70,  4, 25.0, 6.05 },
-    { 17, 20, 12.79, -70,  2, 44.2, 6.53 },
-    { 10, 13, 44.21, -70,  2, 17.2, 3.32 },
-    {  6, 22, 38.21, -69, 59,  3.1, 5.56 },
-    { 13, 11, 51.60, -69, 56, 30.8, 5.91 },
-    {  7, 44, 13.01, -69, 49, 17.0, 6.18 },
-    { 21, 24, 16.70, -69, 44,  3.1, 6.41 },
-    { 14, 11,  1.90, -69, 43, 10.9, 6.06 },
-    {  9, 13, 12.00, -69, 43,  1.9, 1.68 },
-    {  6, 25, 28.61, -69, 41, 25.1, 5.38 },
-    { 13, 15, 25.70, -69, 40, 46.9, 6.37 },
-    { 21, 50, 47.11, -69, 37, 45.8, 5.53 },
-    { 13, 28, 46.39, -69, 37, 41.2, 6.20 },
-    {  0, 20, 39.00, -69, 37, 30.0, 5.51 },
-    {  3, 24,  2.50, -69, 37, 28.9, 6.15 },
-    { 20, 35, 51.70, -69, 36, 40.0, 6.11 },
-    {  0, 55,   .31, -69, 31, 36.8, 5.45 },
-    { 21, 28, 44.90, -69, 30, 19.1, 5.34 },
-    {  0, 52, 24.29, -69, 30, 15.8, 6.22 },
-    { 12, 42,  5.11, -69, 24, 27.0, 6.33 },
-    { 13, 51, 47.40, -69, 24,  5.0, 5.75 },
-    {  3, 25, 36.19, -69, 20, 11.0, 5.96 },
-    { 16, 59, 33.79, -69, 16,  5.9, 5.79 },
-    {  3,  7, 49.20, -69, 15, 56.2, 6.15 },
-    { 12,  2, 37.70, -69, 11, 31.9, 5.89 },
-    { 19, 16, 28.49, -69, 11, 26.2, 6.27 },
-    { 19, 58, 41.30, -69,  9, 50.0, 5.75 },
-    { 12, 37, 10.99, -69,  8,  8.2, 2.69 },
-    {  9, 56, 59.69, -69,  6,  6.8, 6.20 },
-    { 16, 48, 39.89, -69,  1, 40.1, 1.92 },
-    {  1, 15, 46.10, -68, 52, 34.0, 4.86 },
-    {  6,  8, 44.21, -68, 50, 35.9, 5.06 },
-    {  7,  6, 14.09, -68, 50, 13.9, 6.47 },
-    { 12, 45,  1.70, -68, 49, 52.0, 6.16 },
-    { 23,  4, 52.20, -68, 49, 13.1, 5.52 },
-    { 20, 49, 18.10, -68, 46, 35.0, 5.41 },
-    { 19, 58, 52.99, -68, 45, 43.9, 6.39 },
-    { 19,  3, 29.69, -68, 45, 19.1, 5.88 },
-    {  9, 17, 17.21, -68, 41, 21.8, 5.39 },
-    {  9,  1,  8.50, -68, 41,  2.0, 5.88 },
-    { 10,  9, 30.50, -68, 40, 59.9, 5.81 },
-    { 15, 18, 54.60, -68, 40, 45.8, 2.89 },
-    {  2, 21, 44.90, -68, 39, 33.8, 4.09 },
-    { 12,  6, 19.80, -68, 39,  2.9, 6.23 },
-    {  5, 27,   .00, -68, 37, 22.1, 6.03 },
-    {  8,  7, 55.80, -68, 37,  1.9, 4.35 },
-    { 15, 55, 29.59, -68, 36, 11.2, 5.09 },
-    { 19, 31, 10.90, -68, 26,  2.0, 5.96 },
-    { 19,  9, 52.70, -68, 25, 28.9, 5.33 },
-    { 23, 47, 23.30, -68, 23, 39.1, 6.89 },
-    { 19, 24,  5.40, -68, 22, 16.0, 6.34 },
-    { 12,  4, 38.71, -68, 19, 45.1, 5.35 },
-    { 15, 26, 14.69, -68, 18, 33.1, 5.89 },
-    { 12, 22, 11.90, -68, 18, 27.0, 5.74 },
-    { 16, 41, 23.30, -68, 17, 46.0, 5.91 },
-    {  2, 39, 35.40, -68, 16,   .8, 4.11 },
-    { 18, 18,   .91, -68, 13, 45.1, 6.33 },
-    {  8, 43, 54.31, -68, 12, 42.1, 6.32 },
-    { 21,  1, 28.10, -68, 12, 34.9, 6.37 },
-    { 14, 25,  6.29, -68, 11, 43.1, 5.61 },
-    { 12, 46, 16.90, -68,  6, 29.2, 3.05 },
-    { 12, 17, 34.10, -67, 57, 38.9, 4.11 },
-    {  7, 16, 49.80, -67, 57, 25.9, 3.98 },
-    { 16, 17,  5.50, -67, 56, 29.0, 5.75 },
-    { 14, 37, 46.30, -67, 55, 55.9, 6.04 },
-    {  6, 59, 50.50, -67, 54, 58.0, 5.17 },
-    { 13, 15, 14.90, -67, 53, 39.8, 4.80 },
-    {  2, 14, 14.69, -67, 50, 30.1, 5.55 },
-    { 11, 17, 19.01, -67, 49, 25.0, 6.06 },
-    { 17, 21, 59.40, -67, 46, 14.2, 4.78 },
-    {  2, 15, 28.51, -67, 44, 47.0, 5.69 },
-    { 14, 31, 16.51, -67, 43,  1.9, 5.83 },
-    { 16, 52, 17.40, -67, 40, 54.8, 6.32 },
-    { 13, 54, 48.91, -67, 39,  9.0, 5.71 },
-    {  1, 54, 56.09, -67, 38, 49.9, 4.69 },
-    { 12, 23, 13.80, -67, 37, 54.1, 6.36 },
-    { 11, 37, 48.41, -67, 37, 13.1, 5.96 },
-    {  2, 45, 32.59, -67, 37,   .1, 4.84 },
-    { 12, 22,  7.30, -67, 31, 18.8, 5.15 },
-    { 22, 28, 37.70, -67, 29, 21.1, 5.55 },
-    { 15, 20, 40.70, -67, 28, 53.0, 6.28 },
-    { 23, 18, 19.99, -67, 28, 16.0, 6.13 },
-    { 16, 43, 22.10, -67, 25, 57.0, 6.03 },
-    { 20,  5, 32.81, -67, 19, 14.9, 6.07 },
-    { 18, 56, 57.00, -67, 14,  1.0, 4.44 },
-    { 17, 13, 17.50, -67, 11, 48.1, 5.89 },
-    { 12, 38, 52.51, -67, 11, 35.2, 6.25 },
-    {  5, 13, 45.41, -67, 11,  7.1, 4.83 },
-    { 16, 46, 40.01, -67,  6, 34.9, 5.13 },
-    { 15,  9, 29.90, -67,  5,  3.1, 5.76 },
-    {  9, 17, 51.70, -67,  3,  2.9, 6.11 },
-    { 10, 30,  8.71, -66, 59,  6.0, 6.19 },
-    { 11, 32, 19.90, -66, 57, 43.9, 5.90 },
-    { 20,  0, 22.99, -66, 56, 57.8, 5.76 },
-    { 20,  1, 52.39, -66, 56, 39.1, 5.31 },
-    {  3, 17, 58.99, -66, 55, 36.8, 6.05 },
-    { 10, 22, 58.10, -66, 54,  6.1, 4.99 },
-    {  5, 49, 53.59, -66, 54,  4.0, 5.11 },
-    { 23, 10, 11.69, -66, 51, 27.0, 6.47 },
-    { 11, 48, 14.30, -66, 48, 52.9, 4.72 },
-    { 19, 49, 53.30, -66, 48, 46.1, 6.45 },
-    {  8, 50, 34.80, -66, 47, 35.2, 5.35 },
-    { 13, 17, 13.01, -66, 47,  1.0, 4.87 },
-    { 20, 41, 57.10, -66, 45, 38.9, 5.15 },
-    { 11, 45, 36.41, -66, 43, 43.0, 3.64 },
-    {  9, 31, 32.90, -66, 43,  9.8, 6.27 },
-    {  2, 43, 26.59, -66, 42, 51.8, 6.26 },
-    {  9, 28, 30.60, -66, 42,  6.8, 5.91 },
-    { 19, 39, 52.10, -66, 41,  8.2, 6.39 },
-    {  4, 53, 30.50, -66, 40, 32.2, 6.41 },
-    { 19, 17, 12.00, -66, 39, 41.0, 5.53 },
-    { 19,  0,  3.50, -66, 39, 11.9, 6.01 },
-    { 14, 48, 44.40, -66, 35, 38.0, 5.91 },
-    { 14, 16, 38.59, -66, 35, 16.1, 5.75 },
-    { 23, 27,  7.20, -66, 34, 52.0, 6.45 },
-    {  5, 36, 54.70, -66, 33, 37.1, 6.31 },
-    { 12, 39, 55.61, -66, 30, 42.1, 6.26 },
-    {  2, 25, 26.30, -66, 29, 40.9, 6.41 },
-    {  3, 30, 51.60, -66, 29, 22.9, 5.83 },
-    {  1, 17,  3.60, -66, 23, 53.2, 6.24 },
-    {  9,  2, 26.81, -66, 23, 46.0, 4.00 },
-    { 10, 13, 30.60, -66, 22, 23.2, 5.16 },
-    { 20,  8, 20.50, -66, 21, 16.9, 6.45 },
-    { 15, 36, 43.20, -66, 19,   .8, 4.11 },
-    { 14,  0, 52.20, -66, 16,  7.0, 5.97 },
-    { 13, 12, 48.91, -66, 13, 36.8, 5.90 },
-    { 20, 44, 57.50, -66, 12, 11.2, 3.42 },
-    {  7, 49, 40.99, -66, 11, 44.9, 5.79 },
-    { 20,  8, 43.61, -66, 10, 54.8, 3.56 },
-    { 14, 25, 39.50, -66, 10, 23.9, 6.36 },
-    {  8, 25, 44.21, -66,  8, 12.8, 3.77 },
-    {  7, 44, 43.90, -66,  4, 18.8, 6.38 },
-    {  1, 59, 41.09, -66,  3, 59.0, 6.10 },
-    {  6,  6,  9.41, -66,  2, 22.9, 5.71 },
-    { 14, 54, 42.41, -65, 59, 29.0, 6.09 },
-    { 19, 41, 37.49, -65, 51, 15.1, 6.09 },
-    { 12, 20, 28.01, -65, 50, 34.1, 6.21 },
-    {  8, 44, 30.00, -65, 49, 32.2, 6.05 },
-    { 14, 27,  7.10, -65, 49, 18.1, 5.85 },
-    { 10,  8, 42.60, -65, 48, 55.1, 5.28 },
-    { 13, 58, 31.20, -65, 48,  2.2, 6.20 },
-    { 12, 25, 17.30, -65, 46, 14.2, 6.30 },
-    {  3, 34, 24.70, -65, 45, 51.8, 6.75 },
-    {  5, 44, 46.39, -65, 44,  8.2, 4.35 },
-    { 12,  6, 23.11, -65, 42, 33.1, 6.06 },
-    { 10, 27, 25.30, -65, 42, 16.9, 6.01 },
-    { 12, 17,  6.00, -65, 41, 34.1, 6.06 },
-    { 13, 33, 35.69, -65, 37, 57.0, 6.37 },
-    {  8, 18, 18.91, -65, 36, 47.9, 5.07 },
-    { 15, 36, 17.40, -65, 36, 47.9, 6.51 },
-    { 19, 51,  1.30, -65, 36, 18.0, 6.05 },
-    {  6, 11, 15.00, -65, 35, 21.8, 5.01 },
-    { 23, 59, 55.01, -65, 34, 37.9, 4.50 },
-    {  6, 30,  3.00, -65, 34,  5.9, 6.29 },
-    { 12,  5, 53.21, -65, 32, 49.9, 6.33 },
-    { 16, 35, 44.81, -65, 29, 43.1, 5.52 },
-    { 17, 53, 18.41, -65, 29, 21.1, 6.49 },
-    {  0, 42, 28.39, -65, 28,  5.2, 5.39 },
-    {  1,  2, 42.91, -65, 27, 22.0, 6.21 },
-    { 15, 47, 53.71, -65, 26, 33.0, 6.39 },
-    { 15, 47, 53.59, -65, 26, 33.0, 6.18 },
-    {  1, 57, 53.59, -65, 25, 28.9, 6.37 },
-    { 11, 39, 29.40, -65, 23, 52.1, 5.17 },
-    { 16, 51, 53.90, -65, 22, 32.2, 6.13 },
-    { 21, 26, 26.59, -65, 21, 58.0, 4.22 },
-    { 13,  8,  7.01, -65, 18, 23.0, 5.51 },
-    { 15,  7, 56.81, -65, 16, 32.2, 6.17 },
-    { 11, 51, 51.19, -65, 12, 22.0, 4.90 },
-    { 15, 52, 56.71, -65,  9,  9.0, 6.54 },
-    { 13, 16, 44.81, -65,  8, 17.9, 6.07 },
-    {  0, 36, 37.39, -65,  7, 28.9, 6.42 },
-    { 10, 40, 11.30, -65,  6,  2.2, 5.52 },
-    { 18, 48, 37.80, -65,  4, 40.1, 5.73 },
-    {  9, 47,  6.70, -65,  4, 21.0, 6.26 },
-    {  9, 47,  6.10, -65,  4, 18.8, 3.01 },
-    { 15, 58, 58.10, -65,  2, 16.1, 5.75 },
-    { 14, 42, 30.41, -64, 58, 31.1, 3.19 },
-    { 22, 27, 19.99, -64, 57, 59.0, 4.48 },
-    { 11, 23, 21.79, -64, 57, 18.0, 5.11 },
-    {  9, 36,  5.11, -64, 57,  2.2, 6.56 },
-    {  9, 26, 44.21, -64, 55, 46.9, 6.05 },
-    {  0, 20,  4.30, -64, 52, 28.9, 4.23 },
-    { 18, 45, 26.90, -64, 52, 17.0, 4.79 },
-    { 11,  6, 24.19, -64, 50, 22.9, 6.41 },
-    { 21, 38,  2.90, -64, 49, 27.1, 6.20 },
-    {  3, 44, 12.00, -64, 48, 24.8, 3.85 },
-    { 17, 45, 43.99, -64, 43, 26.0, 3.62 },
-    { 21, 50,   .10, -64, 42, 45.0, 5.62 },
-    { 23, 35, 12.70, -64, 41, 21.8, 7.40 },
-    { 21, 18,   .31, -64, 40, 54.1, 6.31 },
-    { 10, 19,  4.80, -64, 40, 35.0, 5.67 },
-    { 13, 29,  7.61, -64, 40, 32.9, 6.11 },
-    { 18, 42, 22.51, -64, 38, 35.2, 6.37 },
-    { 12,  6, 52.90, -64, 36, 49.0, 4.15 },
-    {  8, 25, 51.60, -64, 36,  2.9, 5.97 },
-    { 11, 19, 16.51, -64, 34, 57.0, 5.99 },
-    { 13, 40, 10.90, -64, 34, 36.8, 5.79 },
-    { 18, 43, 37.20, -64, 33,  4.0, 5.78 },
-    { 18,  7, 48.31, -64, 33,   .0, 6.41 },
-    { 13, 24,   .50, -64, 32,  8.9, 4.53 },
-    { 15, 27, 33.10, -64, 31, 53.0, 5.71 },
-    { 10, 46, 16.51, -64, 30, 54.0, 5.34 },
-    {  7, 28, 51.31, -64, 30, 36.0, 6.39 },
-    {  9,  6,  7.61, -64, 29, 58.9, 6.37 },
-    {  9, 57, 15.19, -64, 29, 21.8, 6.58 },
-    { 13, 25, 13.90, -64, 29,  7.1, 5.31 },
-    {  5, 54, 11.90, -64, 28, 55.9, 6.63 },
-    { 10, 42, 13.99, -64, 27, 59.0, 4.82 },
-    {  2, 54, 20.90, -64, 26,  8.2, 6.56 },
-    { 12, 14, 16.80, -64, 24, 31.0, 6.22 },
-    { 23, 44, 12.00, -64, 24, 15.8, 5.72 },
-    { 10, 42, 57.41, -64, 23, 39.8, 2.76 },
-    { 10, 46, 51.19, -64, 22, 59.9, 4.85 },
-    {  1, 25,  5.30, -64, 22,  9.8, 5.93 },
-    { 12, 28, 18.91, -64, 20, 29.0, 6.04 },
-    { 11, 58, 47.69, -64, 20, 21.1, 5.61 },
-    {  2, 28,  4.39, -64, 17, 58.9, 6.37 },
-    { 23, 57, 35.21, -64, 17, 53.9, 5.00 },
-    {  2, 39, 31.70, -64, 16, 54.8, 6.55 },
-    { 10, 46, 29.69, -64, 15, 47.9, 5.23 },
-    { 10, 43, 51.19, -64, 14, 56.0, 5.77 },
-    {  5, 32, 59.59, -64, 13, 39.0, 5.34 },
-    {  4,  7, 21.60, -64, 13, 21.0, 6.38 },
-    { 10, 28, 52.61, -64, 10, 19.9, 5.29 },
-    { 11, 12, 45.19, -64, 10, 10.9, 5.23 },
-    {  8, 21,  7.70, -64,  6, 22.0, 6.12 },
-    {  2, 58, 47.81, -64,  4, 17.0, 4.99 },
-    { 16, 27, 57.31, -64,  3, 29.2, 5.27 },
-    {  5, 51, 22.99, -64,  2,  1.0, 6.36 },
-    { 15,  4, 48.19, -64,  1, 54.1, 5.17 },
-    { 12, 18, 26.09, -64,  0, 11.2, 4.04 },
-    { 11, 25, 43.20, -63, 58, 22.1, 5.17 },
-    { 10, 44,  6.89, -63, 57, 40.0, 4.82 },
-    { 21,  8, 32.90, -63, 55, 44.0, 5.76 },
-    {  5, 30, 15.91, -63, 55, 40.1, 6.19 },
-    { 18, 19, 40.20, -63, 53, 12.8, 6.18 },
-    {  6, 24, 55.61, -63, 49, 40.1, 6.27 },
-    { 14, 52, 34.99, -63, 48, 36.0, 5.87 },
-    {  8,  8, 24.50, -63, 48,  4.0, 6.28 },
-    { 12, 27, 24.60, -63, 47, 21.1, 6.00 },
-    { 11, 49, 41.09, -63, 47, 17.9, 4.32 },
-    { 16,  1, 10.70, -63, 46, 36.1, 6.41 },
-    {  2, 45, 27.50, -63, 42, 15.8, 5.74 },
-    { 18, 14, 16.20, -63, 41, 21.8, 6.47 },
-    { 13, 57, 38.90, -63, 41, 12.1, 4.71 },
-    { 16, 15, 26.30, -63, 41,  8.2, 3.85 },
-    {  6, 23,  1.30, -63, 40, 59.2, 6.27 },
-    { 18,  8, 34.80, -63, 40,  5.9, 4.35 },
-    { 15,  9, 25.49, -63, 38, 34.1, 6.28 },
-    { 15, 17, 38.90, -63, 36, 38.2, 4.86 },
-    {  8,  0, 19.99, -63, 34,  3.0, 4.82 },
-    { 12, 31, 55.80, -63, 30, 22.0, 5.95 },
-    {  3, 56,  4.01, -63, 27, 49.0, 6.14 },
-    { 15, 55,  8.50, -63, 25, 50.2, 2.85 },
-    {  6, 24, 26.30, -63, 25, 44.0, 6.46 },
-    { 20, 14, 26.90, -63, 24, 56.9, 6.09 },
-    {  5,  7, 34.01, -63, 23, 58.9, 5.20 },
-    {  4, 21, 53.30, -63, 23, 11.0, 5.24 },
-    { 12,  3,  1.51, -63, 18, 46.1, 4.33 },
-    { 13, 11, 53.11, -63, 18, 10.1, 6.33 },
-    {  7, 57, 12.50, -63, 17, 48.8, 6.14 },
-    { 11, 54, 59.81, -63, 16, 44.0, 5.91 },
-    { 16, 55, 24.70, -63, 16, 10.9, 6.02 },
-    {  4, 17, 40.20, -63, 15, 20.2, 5.87 },
-    { 20, 19,  3.00, -63, 13, 52.0, 6.27 },
-    {  4, 44, 57.89, -63, 13, 46.9, 6.46 },
-    { 14,  8, 14.30, -63, 12, 29.2, 6.40 },
-    {  7, 12,  1.99, -63, 11, 24.0, 6.02 },
-    { 22, 52,  9.91, -63, 11, 19.0, 6.12 },
-    { 12,  4, 19.20, -63,  9, 56.2, 4.72 },
-    { 16, 25, 22.01, -63,  7, 28.9, 6.15 },
-    { 12, 26, 30.91, -63,  7, 21.0, 4.86 },
-    { 23, 29,  1.01, -63,  6, 38.9, 5.68 },
-    { 12, 26, 36.50, -63,  5, 57.8, 1.73 },
-    { 12, 26, 35.90, -63,  5, 57.1, 1.33 },
-    {  5, 54,  6.10, -63,  5, 24.0, 4.65 },
-    { 12, 42, 50.30, -63,  3, 31.0, 5.31 },
-    { 18, 15, 40.90, -63,  3, 20.2, 5.60 },
-    { 17, 28,  7.70, -63,  2, 11.0, 6.24 },
-    {  0, 32, 43.80, -63,  1, 52.0, 5.09 },
-    { 18, 25, 31.51, -63,  1, 17.0, 6.14 },
-    { 11, 35, 46.80, -63,  1, 10.9, 3.13 },
-    {  0, 31, 33.60, -62, 57, 56.9, 4.54 },
-    {  0, 31, 32.71, -62, 57, 29.2, 4.37 },
-    { 23, 57, 19.90, -62, 57, 23.0, 5.97 },
-    { 12, 12, 22.01, -62, 57,  2.9, 5.92 },
-    {  3, 29, 22.70, -62, 56, 15.0, 4.72 },
-    {  8, 15, 15.91, -62, 54, 56.9, 5.16 },
-    {  2, 52, 19.20, -62, 54, 34.9, 6.03 },
-    { 20, 39, 51.41, -62, 54, 28.1, 6.22 },
-    { 11, 43, 52.90, -62, 52, 41.9, 6.10 },
-    { 14, 45, 17.30, -62, 52, 32.9, 5.36 },
-    {  0, 53, 37.90, -62, 52, 17.0, 5.70 },
-    { 17, 24,  1.10, -62, 51, 51.1, 5.70 },
-    {  8, 37, 18.79, -62, 51, 13.0, 5.47 },
-    { 23, 49, 44.69, -62, 50, 21.8, 6.59 },
-    {  8,  4, 42.89, -62, 50, 10.0, 6.30 },
-    {  4, 33, 34.01, -62, 49, 25.0, 5.79 },
-    {  2, 49,  1.49, -62, 48, 24.1, 5.26 },
-    { 18, 56, 54.70, -62, 48,  4.0, 6.48 },
-    {  9, 32, 14.59, -62, 47, 20.0, 6.10 },
-    { 14, 56, 43.99, -62, 46, 50.9, 5.11 },
-    {  9, 50, 55.70, -62, 44, 43.1, 5.57 },
-    { 23, 14,  6.60, -62, 42,   .0, 6.12 },
-    { 11, 50, 27.19, -62, 38, 57.8, 5.70 },
-    { 15, 53, 22.80, -62, 36, 24.8, 6.19 },
-    { 13, 47, 10.70, -62, 35, 24.0, 6.51 },
-    {  2, 33, 33.60, -62, 35, 12.8, 6.77 },
-    {  3, 17, 46.20, -62, 34, 31.1, 5.54 },
-    { 16,  2, 52.39, -62, 32, 30.1, 6.25 },
-    {  4, 27, 45.91, -62, 31, 14.9, 5.75 },
-    {  9, 45, 14.81, -62, 30, 28.1, 3.69 },
-    {  3, 18, 12.89, -62, 30, 23.0, 5.24 },
-    {  0, 44, 32.30, -62, 29, 52.1, 6.07 },
-    {  5, 33, 37.49, -62, 29, 22.9, 3.76 },
-    { 11, 43, 31.20, -62, 29, 21.8, 5.03 },
-    {  4, 14, 25.51, -62, 28, 26.0, 3.35 },
-    { 11, 57, 40.10, -62, 26, 56.0, 5.57 },
-    { 20, 51, 38.30, -62, 25, 45.1, 6.28 },
-    { 20, 51, 38.81, -62, 25, 45.1, 6.59 },
-    { 11,  6, 32.40, -62, 25, 27.1, 4.61 },
-    {  9, 20, 56.81, -62, 24, 16.9, 4.81 },
-    {  9, 11, 16.61, -62, 19,  1.9, 3.97 },
-    {  5, 29, 17.40, -62, 18, 51.8, 6.59 },
-    { 18, 31, 22.39, -62, 16, 41.9, 4.64 },
-    {  9, 28, 46.99, -62, 16, 23.2, 5.92 },
-    {  4, 14, 48.70, -62, 11, 30.8, 5.45 },
-    { 18, 52, 13.01, -62, 11, 15.0, 4.22 },
-    {  4,  0, 53.81, -62,  9, 33.8, 4.51 },
-    { 10,  2, 49.39, -62,  9, 23.0, 6.42 },
-    {  6,  7,  3.41, -62,  9, 16.9, 5.05 },
-    { 11, 40, 53.59, -62,  5, 24.0, 4.94 },
-    {  4, 36, 45.60, -62,  4, 39.0, 5.40 },
-    { 18, 10, 26.11, -62,  0,  7.9, 5.49 },
-    { 23, 16, 57.70, -62,  0,  4.0, 5.66 },
-    { 22, 33,   .10, -61, 58, 55.9, 4.81 },
-    {  9, 25, 27.10, -61, 57,  1.1, 5.77 },
-    { 11,  8, 34.01, -61, 56, 49.9, 5.13 },
-    {  6, 48, 11.40, -61, 56, 29.0, 3.27 },
-    { 21, 55, 11.50, -61, 53, 11.0, 5.90 },
-    { 10,  3, 34.30, -61, 53,  2.0, 6.14 },
-    {  6, 31, 10.61, -61, 52, 46.9, 6.15 },
-    { 12, 35, 28.99, -61, 50, 30.8, 6.22 },
-    { 10, 54, 29.59, -61, 49, 36.1, 5.93 },
-    { 11, 38,  7.30, -61, 49, 35.0, 5.15 },
-    { 12, 28, 25.49, -61, 47, 43.1, 6.22 },
-    {  1,  7, 18.70, -61, 46, 31.1, 5.37 },
-    { 15, 13,  1.01, -61, 44, 38.0, 6.32 },
-    { 13, 37, 12.19, -61, 41, 30.8, 5.63 },
-    { 10, 32,  1.39, -61, 41,  7.1, 3.32 },
-    { 22, 48, 21.41, -61, 41,  3.1, 6.37 },
-    { 17, 10,  6.29, -61, 40, 32.2, 6.39 },
-    { 10, 13, 21.19, -61, 39, 32.0, 6.41 },
-    {  9, 24,  5.69, -61, 38, 56.0, 5.99 },
-    { 16, 30, 49.39, -61, 38,  1.0, 5.20 },
-    {  1, 58, 46.20, -61, 34, 10.9, 2.86 },
-    { 10,  9, 21.89, -61, 32, 57.1, 5.60 },
-    {  6, 38,   .60, -61, 31, 59.2, 6.18 },
-    { 20, 37, 35.30, -61, 31, 48.0, 4.88 },
-    { 18, 23, 13.61, -61, 29, 38.0, 4.36 },
-    { 14,  0, 17.30, -61, 28, 53.0, 6.49 },
-    { 15, 10, 44.59, -61, 25, 21.0, 6.30 },
-    {  3, 58, 44.69, -61, 24,  1.1, 4.56 },
-    { 10, 30, 39.19, -61, 21, 22.0, 6.43 },
-    { 10, 17,  4.99, -61, 19, 55.9, 3.40 },
-    {  9, 39, 21.00, -61, 19, 41.2, 4.52 },
-    { 10, 59, 13.99, -61, 19, 13.1, 6.16 },
-    {  8,  9,   .70, -61, 18,  9.0, 4.76 },
-    { 11, 37,   .60, -61, 16, 59.9, 5.15 },
-    { 11, 31, 15.00, -61, 16, 41.9, 6.38 },
-    { 12, 11,  4.90, -61, 16, 39.0, 6.08 },
-    { 14, 19, 51.50, -61, 16, 23.2, 5.23 },
-    {  4, 25,  5.30, -61, 14, 17.9, 5.94 },
-    { 11, 46, 30.79, -61, 10, 41.9, 4.11 },
-    {  5, 34, 57.60, -61, 10, 32.9, 6.32 },
-    { 19, 54, 40.39, -61, 10, 14.9, 6.24 },
-    { 11, 26, 35.30, -61,  6, 55.1, 5.30 },
-    { 18, 45, 11.50, -61,  5, 42.0, 6.04 },
-    {  4,  1, 18.19, -61,  4, 44.0, 4.97 },
-    { 19, 50, 21.70, -61,  3, 41.0, 6.21 },
-    { 11, 36, 22.30, -61,  3,  7.9, 5.83 },
-    {  3, 32, 51.60, -61,  1,   .8, 6.41 },
-    { 16, 38, 52.70, -60, 59, 25.1, 6.18 },
-    { 13, 22, 37.90, -60, 59, 17.9, 4.53 },
-    { 10, 34, 12.91, -60, 59, 16.1, 6.23 },
-    { 12, 45, 37.90, -60, 58, 52.0, 4.69 },
-    { 13, 22, 35.69, -60, 58, 19.9, 6.18 },
-    { 12,  4, 57.10, -60, 58,  9.1, 5.96 },
-    {  9,  0, 45.70, -60, 57, 50.0, 5.79 },
-    { 15, 16, 56.71, -60, 57, 27.0, 5.09 },
-    {  4, 16, 21.10, -60, 56, 55.0, 6.37 },
-    { 15, 16, 36.41, -60, 54, 14.0, 5.73 },
-    {  1, 55, 46.39, -60, 51, 41.0, 6.06 },
-    { 12,  8, 24.60, -60, 50, 49.9, 6.22 },
-    { 14, 39, 36.10, -60, 50,  8.2, 1.33 },
-    { 14, 39, 35.90, -60, 50,  7.1,-0.01 },
-    {  7, 58, 50.50, -60, 49, 27.8, 5.81 },
-    {  1, 41, 48.00, -60, 47, 21.8, 5.71 },
-    { 15, 54, 52.61, -60, 44, 35.9, 6.15 },
-    {  0, 58, 22.39, -60, 41, 47.0, 6.23 },
-    { 17, 31,  5.90, -60, 41,  2.0, 3.62 },
-    { 17, 24, 18.70, -60, 40, 25.0, 5.77 },
-    { 15, 23, 10.39, -60, 39, 24.8, 5.67 },
-    {  8, 55,  2.81, -60, 38, 40.9, 3.84 },
-    { 10, 46, 16.80, -60, 36, 11.9, 6.25 },
-    {  7, 59, 37.61, -60, 35, 12.8, 5.17 },
-    { 20, 35, 34.80, -60, 34, 54.1, 4.76 },
-    { 10, 43, 32.09, -60, 34,   .1, 4.57 },
-    { 20, 40,  2.59, -60, 32, 56.0, 5.12 },
-    {  7, 56, 18.60, -60, 31, 35.0, 5.74 },
-    { 10, 55, 17.21, -60, 31,   .8, 5.92 },
-    { 22, 44, 16.51, -60, 29, 57.8, 6.30 },
-    { 15, 18, 48.91, -60, 29, 47.0, 5.46 },
-    { 15, 56,  6.00, -60, 28, 58.1, 5.76 },
-    { 16, 40, 50.50, -60, 26, 46.0, 6.18 },
-    { 10,  2,   .00, -60, 25, 14.9, 5.94 },
-    { 12, 21, 21.60, -60, 24,  4.0, 3.59 },
-    { 12, 50, 12.00, -60, 24,  2.9, 6.75 },
-    { 12, 53, 49.10, -60, 22, 36.8, 5.90 },
-    { 14,  3, 49.39, -60, 22, 23.2, 0.61 },
-    {  8, 53, 48.70, -60, 21, 15.1, 5.78 },
-    { 12, 51, 17.81, -60, 19, 46.9, 5.72 },
-    { 12, 53, 21.79, -60, 19, 43.0, 5.76 },
-    { 11, 12, 36.00, -60, 19,  3.0, 4.60 },
-    {  8, 39, 13.20, -60, 19,  1.9, 6.36 },
-    {  2, 24, 53.90, -60, 18, 42.8, 5.35 },
-    {  7, 57, 46.90, -60, 18, 11.9, 5.60 },
-    {  9, 23, 27.41, -60, 18,  9.0, 6.30 },
-    { 15, 43, 55.10, -60, 17, 13.9, 6.48 },
-    {  7, 49, 12.89, -60, 17,  1.0, 5.78 },
-    {  6, 24, 13.70, -60, 16, 52.0, 5.80 },
-    {  0, 42, 41.81, -60, 15, 45.0, 5.98 },
-    { 22, 18, 30.10, -60, 15, 34.9, 2.86 },
-    {  6, 50,  1.10, -60, 14, 57.1, 6.11 },
-    {  7, 59, 40.20, -60, 12, 27.0, 6.33 },
-    { 18, 58, 36.41, -60, 12,  2.2, 5.14 },
-    { 10,  2, 59.90, -60, 10, 43.0, 6.19 },
-    { 15, 55, 32.30, -60, 10, 40.1, 5.77 },
-    { 17, 51, 35.50, -60,  9, 51.8, 5.78 },
-    { 14, 55, 34.61, -60,  6, 51.1, 5.20 },
-    {  6,  2,  9.19, -60,  5, 48.8, 6.45 },
-    { 23, 22, 56.90, -60,  3, 20.9, 6.09 },
-    {  7, 49, 54.79, -60,  3,  4.0, 6.72 },
-    { 14, 35, 17.21, -60,  0, 56.9, 6.40 },
-    { 13, 12, 17.40, -59, 55, 14.9, 4.60 },
-    { 10, 48,  5.40, -59, 55,  9.1, 6.00 },
-    { 10, 13,  1.30, -59, 55,  5.2, 6.10 },
-    { 14, 16, 34.20, -59, 54, 50.0, 6.39 },
-    { 15, 39, 56.50, -59, 54, 29.9, 5.95 },
-    { 10, 16,  3.10, -59, 54, 11.9, 6.22 },
-    { 22, 51, 44.90, -59, 52, 53.0, 6.46 },
-    { 13,  7, 24.19, -59, 51, 38.2, 5.99 },
-    { 17, 35, 34.90, -59, 50, 46.0, 6.28 },
-    { 13, 12, 55.99, -59, 49,   .1, 6.16 },
-    { 13, 20, 34.90, -59, 46, 23.9, 6.18 },
-    {  8, 40, 37.01, -59, 45, 40.0, 4.33 },
-    {  3,  3, 36.79, -59, 44, 16.1, 5.11 },
-    {  4, 44, 21.10, -59, 43, 58.1, 5.27 },
-    { 10, 57, 48.41, -59, 43, 54.8, 6.11 },
-    { 14,  6, 25.10, -59, 42, 56.2, 6.42 },
-    { 17, 19, 12.41, -59, 41, 39.8, 5.91 },
-    { 12, 47, 43.20, -59, 41, 19.0, 1.25 },
-    { 12, 41, 56.59, -59, 41,  8.9, 4.93 },
-    { 10, 45,  3.60, -59, 41,  3.1, 6.21 },
-    { 10, 41, 17.59, -59, 40, 36.8, 6.42 },
-    { 22,  5, 50.90, -59, 38, 10.0, 5.62 },
-    { 11, 13, 30.79, -59, 37,  9.8, 5.74 },
-    { 10, 36, 20.30, -59, 33, 52.9, 5.08 },
-    { 11, 31, 48.79, -59, 30, 56.9, 5.15 },
-    {  8, 22, 30.79, -59, 30, 34.9, 1.86 },
-    {  0, 40, 26.40, -59, 27, 15.8, 5.89 },
-    { 11, 31, 46.10, -59, 26, 31.9, 5.13 },
-    {  9, 51, 12.10, -59, 25, 32.9, 5.79 },
-    { 12, 31, 40.30, -59, 25, 26.0, 5.48 },
-    {  9, 12, 55.61, -59, 24, 51.8, 5.54 },
-    { 20,  1, 44.69, -59, 22, 34.0, 5.13 },
-    {  6, 52, 45.41, -59, 20, 28.0, 6.41 },
-    { 10, 49, 24.10, -59, 19, 25.0, 5.91 },
-    { 15, 23, 22.70, -59, 19, 14.9, 4.51 },
-    {  4, 16, 28.90, -59, 18,  6.8, 4.44 },
-    { 14,  8, 56.30, -59, 16, 36.1, 6.34 },
-    {  9, 17,  5.40, -59, 16, 31.1, 2.25 },
-    {  9, 34, 26.71, -59, 13, 45.8, 4.08 },
-    {  8, 56, 58.39, -59, 13, 45.8, 4.92 },
-    { 10, 42, 40.61, -59, 12, 56.9, 5.38 },
-    {  6, 16, 18.50, -59, 12, 49.0, 6.43 },
-    { 14, 28, 43.49, -59, 11, 52.1, 6.45 },
-    { 19, 50, 44.81, -59, 11, 35.2, 5.42 },
-    { 10, 38, 45.10, -59, 10, 59.2, 4.66 },
-    {  7,  3, 15.60, -59, 10, 41.2, 5.50 },
-    {  8, 17, 55.80, -59, 10,   .8, 6.42 },
-    { 12, 54, 39.19, -59,  8, 48.1, 4.62 },
-    {  7, 56, 50.71, -59,  7, 35.0, 6.25 },
-    { 13, 14, 14.81, -59,  6, 11.9, 4.92 },
-    {  8, 59, 24.10, -59,  5,  1.0, 5.16 },
-    { 16, 49, 47.09, -59,  2, 29.0, 3.76 },
-    { 18,  9, 57.60, -59,  2, 24.0, 6.38 },
-    { 21, 58, 30.10, -59,  0, 43.9, 6.12 },
-    { 12, 27, 28.70, -58, 59, 30.8, 5.50 },
-    { 11,  8, 35.40, -58, 58, 30.0, 3.91 },
-    {  9, 10, 58.01, -58, 58,   .8, 3.44 },
-    { 17,  1, 47.40, -58, 57, 29.9, 6.11 },
-    {  4, 40, 18.29, -58, 56, 37.0, 6.53 },
-    {  7,  1,  5.09, -58, 56, 24.0, 6.02 },
-    {  5, 26, 19.30, -58, 54, 45.0, 5.14 },
-    { 12, 43, 28.20, -58, 54, 11.2, 6.40 },
-    { 19, 57,  6.19, -58, 54,  5.0, 5.26 },
-    {  5, 35,  2.40, -58, 52, 16.0, 6.75 },
-    { 10, 53, 29.59, -58, 51, 11.9, 3.78 },
-    { 10, 11, 35.21, -58, 49, 41.2, 6.40 },
-    { 10, 38, 59.40, -58, 49,   .8, 5.92 },
-    { 15, 17, 30.79, -58, 48,  4.0, 4.07 },
-    {  9, 45, 55.39, -58, 47, 39.1, 6.22 },
-    { 13, 42,  1.10, -58, 47, 13.9, 5.38 },
-    {  6, 31, 58.39, -58, 45, 15.1, 5.70 },
-    { 12, 15,  8.71, -58, 44, 56.0, 2.80 },
-    { 10, 27, 52.70, -58, 44, 21.8, 3.82 },
-    { 10, 37, 26.81, -58, 43, 59.9, 5.45 },
-    {  8, 45,  5.30, -58, 43, 30.0, 6.21 },
-    { 18, 33, 29.50, -58, 42, 33.1, 6.44 },
-    { 13, 14, 12.10, -58, 41,  2.0, 5.89 },
-    { 11,  6, 29.30, -58, 40, 31.1, 6.02 },
-    { 10, 32, 47.59, -58, 40,   .8, 6.00 },
-    {  7, 42, 10.20, -58, 37, 50.9, 6.43 },
-    { 14, 41, 55.70, -58, 36, 58.0, 6.22 },
-    { 16, 28, 15.19, -58, 35, 58.9, 5.69 },
-    { 10, 24, 59.40, -58, 34, 35.0, 5.95 },
-    {  4, 54, 52.99, -58, 32, 49.9, 6.12 },
-    {  6, 23, 46.90, -58, 32, 38.0, 6.48 },
-    { 16, 46, 21.19, -58, 30, 13.0, 5.74 },
-    { 14, 44, 55.49, -58, 28, 40.1, 6.11 },
-    { 23, 27, 15.00, -58, 28, 34.0, 5.63 },
-    { 14, 22, 37.01, -58, 27, 33.8, 4.92 },
-    { 11, 10, 54.70, -58, 27, 19.1, 6.88 },
-    { 20, 54, 48.60, -58, 27, 15.1, 3.65 },
-    { 12, 54, 22.01, -58, 25, 50.2, 6.58 },
-    { 13, 38,  7.61, -58, 24, 54.0, 6.42 },
-    {  9, 15, 17.50, -58, 23, 19.0, 6.02 },
-    {  9, 30, 23.40, -58, 21, 42.1, 5.88 },
-    { 16, 47, 19.51, -58, 20, 29.0, 5.58 },
-    {  1, 36, 44.81, -58, 16, 14.9, 6.18 },
-    {  8, 54, 54.00, -58, 14, 24.0, 6.38 },
-    { 23, 17, 25.80, -58, 14,  8.9, 3.99 },
-    {  7, 42, 53.30, -58, 13, 48.0, 6.21 },
-    {  8, 35, 15.41, -58, 13, 30.0, 5.26 },
-    { 10, 33, 25.30, -58, 11, 25.1, 6.14 },
-    {  1, 35, 15.19, -58,  8, 21.8, 6.01 },
-    { 10, 11, 46.51, -58,  3, 38.2, 5.72 },
-    { 17, 22, 55.01, -58,  0, 37.1, 5.88 },
-    {  8, 35, 19.61, -58,  0, 33.1, 4.86 },
-    {  6, 27,  4.01, -58,  0,  7.9, 5.82 },
-    {  9, 40, 42.50, -57, 59,  1.0, 5.32 },
-    { 19, 38, 25.90, -57, 58, 59.9, 6.18 },
-    {  8, 21, 12.00, -57, 58, 23.2, 5.97 },
-    { 10, 23, 50.90, -57, 57, 14.0, 6.35 },
-    { 16,  9, 18.60, -57, 56,  3.8, 5.57 },
-    { 19, 56, 57.70, -57, 55, 32.2, 6.53 },
-    { 16, 15, 49.70, -57, 54, 43.9, 5.63 },
-    { 16, 54,   .50, -57, 54, 33.8, 5.94 },
-    { 16, 18, 51.89, -57, 53, 58.9, 6.49 },
-    { 21, 56, 13.99, -57, 53, 57.8, 6.19 },
-    { 22, 35, 52.90, -57, 53,  1.0, 6.23 },
-    {  9,  4, 48.00, -57, 51,  9.0, 6.44 },
-    { 22, 24, 56.40, -57, 47, 49.9, 5.32 },
-    { 16,  3, 31.90, -57, 46, 31.1, 4.63 },
-    { 16, 29, 45.00, -57, 45, 20.9, 6.06 },
-    { 17,  4, 24.70, -57, 42, 43.9, 5.73 },
-    { 11, 47, 19.10, -57, 41, 47.0, 5.41 },
-    {  1, 10,  7.39, -57, 41, 39.8, 6.41 },
-    { 12, 22, 49.30, -57, 40, 34.0, 5.39 },
-    { 10, 27, 24.41, -57, 38, 20.0, 4.66 },
-    {  8, 51, 36.60, -57, 38,  1.0, 5.59 },
-    { 13, 38, 49.10, -57, 37, 23.2, 6.01 },
-    {  9, 15, 34.99, -57, 34, 41.2, 6.32 },
-    { 10, 35, 35.30, -57, 33, 28.1, 4.45 },
-    { 17, 44, 55.80, -57, 32, 43.1, 6.01 },
-    {  8, 40, 43.61, -57, 32, 43.1, 6.34 },
-    {  9, 16, 12.19, -57, 32, 29.0, 4.34 },
-    { 20, 11,  7.20, -57, 31, 26.0, 6.37 },
-    { 18, 29, 56.69, -57, 31, 23.2, 5.76 },
-    { 22, 20, 36.19, -57, 30, 36.0, 6.34 },
-    { 12,  1, 28.99, -57, 30, 13.0, 6.16 },
-    {  5,  5, 30.60, -57, 28, 22.1, 4.72 },
-    { 10, 47, 38.71, -57, 28,  4.1, 6.36 },
-    {  0, 43, 21.19, -57, 27, 47.2, 4.36 },
-    { 22, 40, 48.89, -57, 25, 19.9, 5.97 },
-    { 11, 54, 11.50, -57, 24, 36.0, 6.06 },
-    { 10,  1, 58.01, -57, 20, 58.9, 6.20 },
-    {  3, 12, 33.19, -57, 19, 18.1, 5.74 },
-    {  7, 54, 53.21, -57, 18, 11.2, 5.63 },
-    {  9, 41,  2.21, -57, 15, 34.9, 5.80 },
-    { 10, 38,  2.50, -57, 15, 23.0, 5.91 },
-    { 10, 52, 30.91, -57, 14, 26.2, 5.25 },
-    {  1, 37, 42.89, -57, 14, 12.1, 0.46 },
-    {  9, 45, 40.49, -57, 11,  8.2, 6.46 },
-    { 12, 54, 35.59, -57, 10, 40.1, 4.03 },
-    { 12, 54, 36.79, -57, 10,  5.9, 5.17 },
-    {  5, 52, 20.30, -57,  9, 22.0, 5.94 },
-    { 12, 31,  9.89, -57,  6, 47.9, 1.63 },
-    {  3, 58, 42.89, -57,  6,  9.0, 6.05 },
-    { 14, 14, 57.00, -57,  5,  8.9, 5.07 },
-    { 12, 31, 16.70, -57,  4, 52.0, 6.42 },
-    {  4, 24, 12.19, -57,  4, 17.0, 6.29 },
-    {  9, 31, 13.30, -57,  2,  3.8, 3.13 },
-    {  1,  2,  1.80, -57,  0,  9.0, 6.11 },
-    { 11, 52, 10.10, -56, 59, 16.1, 5.57 },
-    { 10,  0, 34.39, -56, 56, 48.1, 6.52 },
-    { 17, 31, 22.99, -56, 55, 14.2, 5.95 },
-    { 17, 14, 13.20, -56, 53, 17.9, 6.09 },
-    { 14, 32, 32.90, -56, 53, 16.1, 6.93 },
-    { 18, 45, 23.71, -56, 52, 54.1, 6.22 },
-    {  6, 29, 28.51, -56, 51, 10.1, 5.22 },
-    { 23, 25, 19.39, -56, 50, 57.1, 5.59 },
-    { 12, 55, 57.00, -56, 50, 10.0, 5.32 },
-    { 22,  3, 21.60, -56, 47, 10.0, 4.69 },
-    { 11, 23,  8.11, -56, 46, 45.8, 5.79 },
-    {  8, 46, 42.50, -56, 46, 10.9, 4.49 },
-    { 13, 42, 56.09, -56, 46,  5.2, 6.00 },
-    { 10, 46, 57.50, -56, 45, 25.9, 5.23 },
-    {  7,  4, 18.29, -56, 44, 58.9, 5.17 },
-    { 20, 25, 38.90, -56, 44,  6.0, 1.94 },
-    {  7, 45, 35.59, -56, 43, 21.0, 6.12 },
-    { 14, 49,  6.89, -56, 40,  4.1, 6.23 },
-    {  8, 53,  3.79, -56, 38, 57.8, 6.03 },
-    { 17, 23,  6.89, -56, 31, 31.1, 5.80 },
-    { 12, 29, 53.90, -56, 31, 28.9, 5.80 },
-    {  0, 41, 46.39, -56, 30,  6.1, 5.70 },
-    { 12, 46, 22.70, -56, 29, 20.0, 4.65 },
-    {  7, 48, 19.20, -56, 28, 16.0, 6.33 },
-    { 14, 40, 32.81, -56, 26, 26.9, 6.30 },
-    {  9, 48, 40.01, -56, 24, 42.8, 6.06 },
-    {  7, 49,  6.70, -56, 24, 38.2, 5.59 },
-    { 12, 28, 33.41, -56, 24, 28.1, 6.15 },
-    {  6, 58, 36.19, -56, 23, 40.9, 6.45 },
-    { 14, 20, 19.51, -56, 23, 12.1, 4.33 },
-    { 17, 25, 23.59, -56, 22, 39.0, 3.34 },
-    { 12, 21, 57.50, -56, 22, 28.9, 5.92 },
-    {  6, 22, 55.80, -56, 22, 12.0, 5.61 },
-    { 19, 48,  1.20, -56, 21, 45.0, 5.35 },
-    { 11, 58, 15.19, -56, 19,  1.9, 5.44 },
-    { 14,  3, 26.21, -56, 12, 49.0, 5.92 },
-    {  1, 39, 47.40, -56, 11, 53.2, 5.87 },
-    {  1, 39, 47.81, -56, 11, 40.9, 5.76 },
-    { 16,  7, 24.00, -56, 11, 29.0, 6.16 },
-    { 12, 43,  9.10, -56, 10, 34.0, 6.00 },
-    {  5, 49, 49.70, -56, 10,   .1, 4.51 },
-    {  5, 22, 22.10, -56,  8,  3.8, 6.11 },
-    { 10, 18, 37.61, -56,  6, 36.0, 5.81 },
-    {  8,  9, 33.60, -56,  5,  8.2, 5.66 },
-    { 10, 20, 54.79, -56,  2, 35.2, 4.50 },
-    { 18, 17,  7.49, -56,  1, 23.9, 5.33 },
-    { 16, 58, 37.20, -55, 59, 25.1, 3.13 },
-    { 12, 42, 49.61, -55, 56, 49.9, 6.08 },
-    {  2, 19, 54.29, -55, 56, 40.9, 5.81 },
-    {  7, 36,  1.70, -55, 53, 15.0, 6.39 },
-    { 22,  0, 24.10, -55, 52, 58.1, 6.01 },
-    {  9,  6, 34.01, -55, 48, 11.9, 6.11 },
-    { 13, 20, 48.29, -55, 48,  2.2, 6.02 },
-    {  8, 42, 20.90, -55, 46, 27.1, 6.29 },
-    { 21, 40, 33.60, -55, 44, 15.0, 6.33 },
-    {  6, 58, 39.60, -55, 43, 45.8, 6.27 },
-    { 19,  8, 52.10, -55, 43, 13.1, 6.49 },
-    { 10, 39, 18.41, -55, 36, 11.9, 4.28 },
-    { 14, 45, 10.90, -55, 36,  6.8, 6.10 },
-    {  9, 14, 18.00, -55, 34, 10.9, 5.27 },
-    { 16, 13, 22.61, -55, 32, 26.9, 5.81 },
-    {  6, 47, 18.70, -55, 32, 24.0, 5.61 },
-    { 17, 25, 18.00, -55, 31, 48.0, 2.85 },
-    {  9, 21, 49.99, -55, 30, 54.0, 5.63 },
-    {  8,  1, 31.49, -55, 27, 18.0, 6.28 },
-    { 19, 29, 52.61, -55, 26, 29.0, 6.13 },
-    { 17, 48, 38.11, -55, 24,  6.1, 6.11 },
-    {  9, 53,   .00, -55, 22, 23.9, 6.48 },
-    { 15, 11, 16.01, -55, 20, 46.0, 5.54 },
-    {  1,  8, 23.11, -55, 14, 44.9, 3.92 },
-    {  9, 41, 47.81, -55, 12, 51.1, 6.00 },
-    {  8, 29, 36.31, -55, 11, 28.0, 6.36 },
-    {  9, 19, 32.59, -55, 11, 12.1, 6.28 },
-    { 17, 28, 38.71, -55, 10, 10.9, 5.94 },
-    { 12, 18, 59.69, -55,  8, 35.2, 5.00 },
-    { 16, 20, 25.20, -55,  8, 24.0, 5.77 },
-    { 19, 30, 34.49, -55,  6, 36.0, 6.30 },
-    { 15, 51,  6.79, -55,  3, 20.9, 5.73 },
-    { 20, 20, 32.30, -55,  3,  2.9, 6.27 },
-    {  4, 33, 59.81, -55,  2, 42.0, 3.27 },
-    { 10, 19, 36.79, -55,  1, 45.8, 4.57 },
-    { 20,  7, 35.09, -55,  0, 59.0, 6.26 },
-    {  8, 27, 27.41, -55,  0, 42.1, 6.53 },
-    {  9, 22,  6.79, -55,  0, 38.9, 2.50 },
-    { 14, 33, 32.40, -54, 59, 53.9, 5.87 },
-    { 21, 57, 55.10, -54, 59, 33.0, 4.40 },
-    { 19, 52, 39.00, -54, 58, 36.1, 6.50 },
-    { 10, 15, 16.61, -54, 58, 27.1, 6.16 },
-    { 19, 52, 37.61, -54, 58, 16.0, 5.74 },
-    {  6, 10, 17.90, -54, 58,  7.0, 4.81 },
-    {  8, 55, 11.90, -54, 57, 56.2, 5.71 },
-    { 12, 53,  3.91, -54, 57,  9.0, 5.93 },
-    {  5, 33, 44.40, -54, 54,  7.9, 6.43 },
-    { 10, 26, 49.01, -54, 52, 39.0, 5.58 },
-    {  0, 35, 33.41, -54, 49, 18.8, 6.06 },
-    { 21,  5, 14.21, -54, 43, 37.9, 5.16 },
-    {  8, 44, 42.19, -54, 42, 29.9, 1.96 },
-    { 13, 56, 33.00, -54, 42, 15.8, 6.00 },
-    {  6, 46, 41.50, -54, 41, 40.9, 6.46 },
-    { 14,  5, 46.51, -54, 40,  9.8, 6.17 },
-    { 21, 26, 15.41, -54, 39, 38.2, 6.12 },
-    { 16, 13, 28.70, -54, 37, 50.2, 4.94 },
-    { 14, 13, 39.89, -54, 37, 32.9, 6.11 },
-    { 17,  0,  6.19, -54, 35, 48.8, 5.65 },
-    { 16,  1,  6.41, -54, 34, 40.1, 6.13 },
-    {  9, 56, 51.79, -54, 34,  4.1, 3.54 },
-    { 13, 41, 44.69, -54, 33, 36.0, 5.01 },
-    {  2, 40, 39.60, -54, 33,   .0, 5.21 },
-    {  8,  1, 22.90, -54, 30, 54.0, 6.10 },
-    { 17, 38,  5.59, -54, 30,  1.1, 5.25 },
-    {  9, 17, 42.31, -54, 29, 43.1, 6.33 },
-    { 11, 21,   .41, -54, 29, 28.0, 3.89 },
-    { 19, 22, 51.10, -54, 25, 25.0, 5.05 },
-    { 19, 40, 18.31, -54, 25,  3.0, 6.26 },
-    {  5,  5,   .60, -54, 24, 27.0, 6.27 },
-    {  7, 30, 30.91, -54, 23, 57.8, 5.96 },
-    {  8, 31, 29.59, -54, 23, 39.1, 6.34 },
-    {  0, 37, 18.10, -54, 23, 39.1, 6.41 },
-    {  7, 52, 29.69, -54, 22,  1.9, 5.70 },
-    {  5, 47, 13.01, -54, 21, 38.9, 6.18 },
-    { 19, 27, 48.10, -54, 19, 31.1, 5.69 },
-    {  3, 44, 33.79, -54, 16, 26.0, 6.30 },
-    { 11, 34, 45.70, -54, 15, 51.1, 4.62 },
-    {  8,  0, 49.90, -54,  9,  5.0, 5.87 },
-    { 13, 56, 19.80, -54,  7, 54.8, 6.14 },
-    {  6, 52, 46.90, -54,  5, 24.0, 6.57 },
-    { 15, 59, 54.00, -54,  1, 16.0, 6.10 },
-    {  0,  9,  2.40, -54,  0,  6.8, 6.33 },
-    { 11, 40, 42.60, -53, 58,  7.0, 5.96 },
-    { 23,  4, 39.60, -53, 57, 54.0, 5.37 },
-    {  9, 43, 42.19, -53, 53, 30.1, 5.56 },
-    { 12, 52, 24.60, -53, 49, 45.8, 6.24 },
-    { 16, 16, 43.10, -53, 48, 40.0, 5.44 },
-    { 23, 23, 54.31, -53, 48, 29.9, 6.15 },
-    {  1, 42, 29.30, -53, 44, 26.2, 5.52 },
-    { 10, 31, 21.79, -53, 42, 56.2, 4.89 },
-    {  0, 45,   .00, -53, 42, 54.0, 6.15 },
-    { 21, 29,   .31, -53, 42, 20.9, 6.39 },
-    { 16, 13, 16.80, -53, 40, 18.1, 5.83 },
-    {  9, 37, 12.31, -53, 40,  7.0, 5.45 },
-    { 14, 13, 16.39, -53, 39, 56.9, 5.56 },
-    { 22, 18, 15.60, -53, 37, 40.1, 5.37 },
-    {  6, 49, 51.31, -53, 37, 19.9, 4.40 },
-    { 17, 50, 28.20, -53, 36, 43.9, 5.92 },
-    {  9,  3,  5.21, -53, 32, 58.9, 6.40 },
-    {  1, 46,  6.31, -53, 31, 18.8, 5.04 },
-    { 14, 15, 21.19, -53, 30, 34.9, 6.39 },
-    { 22, 45, 37.90, -53, 30,  1.1, 4.85 },
-    { 13, 39, 53.21, -53, 27, 59.0, 2.30 },
-    {  4, 50, 55.20, -53, 27, 41.0, 5.61 },
-    { 13,  7, 38.30, -53, 27, 34.9, 5.71 },
-    {  4, 50, 56.30, -53, 27, 34.9, 6.42 },
-    { 21, 19, 52.01, -53, 26, 58.9, 4.39 },
-    {  8, 39, 23.81, -53, 26, 22.9, 5.48 },
-    { 14,  9, 54.79, -53, 26, 21.1, 4.75 },
-    {  1, 38, 48.19, -53, 26, 20.0, 6.84 },
-    {  5, 57, 14.40, -53, 25, 34.0, 6.45 },
-    { 19, 18,  9.41, -53, 23, 12.1, 6.38 },
-    {  9, 26, 18.10, -53, 22, 45.1, 5.11 },
-    { 13, 53, 43.10, -53, 22, 25.0, 5.89 },
-    { 10,  1, 40.49, -53, 21, 51.8, 6.20 },
-    { 17, 35, 19.99, -53, 21, 10.1, 6.10 },
-    {  7, 39,   .41, -53, 16, 23.9, 6.06 },
-    { 21, 15, 45.91, -53, 15, 47.2, 5.75 },
-    { 17,  3,  8.81, -53, 14, 12.8, 5.29 },
-    { 11, 13, 39.31, -53, 13, 54.1, 5.76 },
-    {  8, 32,  4.80, -53, 12, 43.9, 5.69 },
-    { 15, 50,  6.89, -53, 12, 33.8, 5.77 },
-    { 19, 32, 53.81, -53, 11,  8.9, 5.75 },
-    { 14, 23, 48.41, -53, 10, 36.1, 6.00 },
-    { 16, 59, 35.11, -53,  9, 38.2, 4.06 },
-    { 11, 26, 47.30, -53,  9, 36.0, 5.81 },
-    { 16, 44, 39.79, -53,  9,  9.0, 5.96 },
-    { 17, 51, 10.99, -53,  7, 50.2, 6.09 },
-    {  8, 42, 25.49, -53,  6, 50.0, 4.86 },
-    {  8,  5,  4.01, -53,  6, 29.2, 5.53 },
-    {  8, 42, 18.91, -53,  6,   .0, 5.52 },
-    {  8, 38, 44.90, -53,  5, 26.2, 6.47 },
-    {  8, 27, 36.50, -53,  5, 19.0, 5.09 },
-    { 16, 17, 20.90, -53,  5, 12.1, 6.33 },
-    {  8, 39, 57.60, -53,  3, 18.0, 5.19 },
-    {  8, 40, 17.40, -53,  0, 55.1, 5.61 },
-    {  7, 56, 46.70, -52, 58, 55.9, 3.47 },
-    {  6, 34, 58.61, -52, 58, 32.2, 4.39 },
-    {  9, 36, 46.30, -52, 56, 39.1, 6.19 },
-    { 18, 58, 27.70, -52, 56, 19.0, 4.87 },
-    {  8, 40, 17.59, -52, 55, 18.8, 3.62 },
-    { 18, 34, 31.20, -52, 53, 30.8, 6.22 },
-    { 19, 48, 55.10, -52, 53, 17.2, 6.25 },
-    { 20,  7, 23.21, -52, 52, 50.9, 4.94 },
-    {  4, 18, 40.01, -52, 51, 36.0, 6.09 },
-    {  8, 48,   .19, -52, 51,  2.2, 6.30 },
-    { 13, 52,  4.80, -52, 48, 42.1, 5.25 },
-    { 14, 56, 17.30, -52, 48, 34.9, 5.38 },
-    {  8, 26, 25.20, -52, 48, 27.0, 6.05 },
-    {  6, 24, 48.19, -52, 48, 23.0, 6.51 },
-    { 12, 50, 57.91, -52, 47, 15.0, 5.73 },
-    {  5, 50, 28.61, -52, 46,  4.1, 6.35 },
-    { 23,  0, 52.80, -52, 45, 15.1, 4.12 },
-    { 13, 20, 37.80, -52, 44, 53.2, 5.48 },
-    { 23, 58, 55.80, -52, 44, 44.9, 5.13 },
-    { 21, 33, 17.71, -52, 44, 15.0, 6.41 },
-    {  6, 17, 51.70, -52, 43, 59.2, 6.41 },
-    {  8, 56, 19.39, -52, 43, 25.0, 4.69 },
-    { 23, 26, 36.60, -52, 43, 18.1, 5.52 },
-    {  6, 23, 57.10, -52, 41, 44.9,-0.72 },
-    { 22, 39,  8.40, -52, 41, 31.9, 6.65 },
-    {  3, 54, 34.01, -52, 41, 26.2, 6.46 },
-    { 14, 33, 29.90, -52, 40, 48.0, 5.87 },
-    {  7, 29, 59.59, -52, 39,  4.0, 5.87 },
-    {  9, 57, 10.90, -52, 38, 20.0, 6.12 },
-    {  5, 54, 50.21, -52, 38,  7.1, 5.29 },
-    {  7, 55,   .50, -52, 34, 59.2, 6.38 },
-    {  2, 44, 10.70, -52, 34, 14.2, 6.15 },
-    { 13, 10, 58.39, -52, 34,   .8, 6.06 },
-    {  2, 37, 24.41, -52, 32, 35.2, 5.31 },
-    {  7, 35, 39.70, -52, 32,  2.0, 4.94 },
-    {  7, 15, 21.00, -52, 29, 58.9, 5.97 },
-    { 20, 14, 19.01, -52, 26, 44.2, 5.65 },
-    { 15, 48, 50.30, -52, 26, 17.2, 6.07 },
-    {  6, 45, 53.69, -52, 24, 36.0, 5.80 },
-    { 14, 47,  1.30, -52, 23,  1.0, 5.21 },
-    {  0, 34, 27.79, -52, 22, 23.2, 5.57 },
-    { 15, 38, 49.51, -52, 22, 22.1, 5.44 },
-    { 12, 11, 39.10, -52, 22,  7.0, 3.96 },
-    { 21, 39, 59.69, -52, 21, 33.1, 6.21 },
-    { 19,  6, 19.90, -52, 20, 26.9, 5.16 },
-    {  6, 33, 26.09, -52, 19, 44.0, 6.19 },
-    {  5, 24, 46.20, -52, 18, 59.0, 6.27 },
-    {  7, 20, 21.41, -52, 18, 42.1, 6.05 },
-    {  7, 20, 21.70, -52, 18, 34.9, 6.60 },
-    { 17, 27, 57.60, -52, 17, 49.9, 5.75 },
-    { 16, 56, 28.70, -52, 17,  2.0, 5.94 },
-    { 14, 47, 12.31, -52, 12, 20.2, 6.07 },
-    {  6, 45, 26.09, -52, 12,  4.0, 6.57 },
-    {  9,  1, 44.59, -52, 11, 17.9, 5.23 },
-    { 10,  6,  7.10, -52, 11, 17.2, 6.52 },
-    { 13, 22, 16.20, -52, 10, 59.2, 5.83 },
-    {  5, 15, 38.90, -52, 10, 54.8, 6.49 },
-    {  6, 23, 37.70, -52, 10, 52.0, 5.98 },
-    { 10, 12, 22.99, -52,  9, 47.9, 6.16 },
-    { 13, 55, 12.19, -52,  9, 40.0, 5.71 },
-    {  8, 52, 40.80, -52,  7, 45.1, 6.39 },
-    {  8, 22, 55.20, -52,  7, 26.0, 5.85 },
-    { 13,  5, 30.79, -52,  6, 54.0, 6.43 },
-    {  5, 50, 53.21, -52,  6, 32.0, 5.17 },
-    { 18, 52, 39.60, -52,  6, 27.0, 5.17 },
-    { 15, 12, 17.09, -52,  5, 57.1, 3.41 },
-    {  7, 20, 38.69, -52,  5, 10.0, 5.39 },
-    {  5, 13, 53.30, -52,  1, 52.0, 6.05 },
-    {  7,  7, 13.30, -51, 58,  4.1, 5.96 },
-    { 17, 26, 56.30, -51, 56, 57.1, 6.19 },
-    { 18, 53, 12.10, -51, 55, 52.0, 6.31 },
-    { 20, 44,  2.30, -51, 55, 16.0, 4.51 },
-    { 23, 24, 13.10, -51, 53, 29.0, 5.75 },
-    { 17, 44,  8.71, -51, 50,  3.1, 5.15 },
-    {  6, 31, 18.29, -51, 49, 34.0, 5.60 },
-    { 11,  0,  8.59, -51, 49,  4.1, 6.15 },
-    { 10,  8, 56.30, -51, 48, 40.0, 4.86 },
-    {  1, 57,   .10, -51, 45, 58.0, 6.10 },
-    { 10, 13, 28.01, -51, 45, 22.0, 5.78 },
-    {  9, 23, 59.50, -51, 44, 13.9, 6.08 },
-    {  8, 25, 31.01, -51, 43, 41.2, 5.17 },
-    { 11, 59, 10.90, -51, 41, 48.1, 6.05 },
-    {  4, 39,  4.30, -51, 40, 22.1, 6.44 },
-    {  1, 55, 57.50, -51, 36, 32.0, 3.70 },
-    { 20, 51, 30.10, -51, 36, 29.9, 5.05 },
-    { 15, 28, 27.19, -51, 35, 51.0, 6.10 },
-    {  4,  0, 15.70, -51, 33, 52.9, 6.51 },
-    {  9, 18, 42.19, -51, 33, 38.2, 5.87 },
-    {  9, 30,  5.21, -51, 31,  1.9, 5.45 },
-    {  2, 16, 30.60, -51, 30, 43.9, 3.56 },
-    { 14,  9, 34.99, -51, 30, 16.9, 6.00 },
-    {  4, 16,  1.61, -51, 29, 12.1, 4.25 },
-    {  7, 34, 39.50, -51, 28, 28.9, 6.28 },
-    { 12, 26, 31.61, -51, 27,  2.9, 4.82 },
-    {  7, 58, 21.41, -51, 26, 55.0, 6.44 },
-    { 14, 57,  1.39, -51, 26, 48.8, 6.64 },
-    { 13, 46, 39.31, -51, 25, 58.1, 4.65 },
-    {  7,  0, 51.50, -51, 24,  9.0, 5.14 },
-    { 12, 11, 31.39, -51, 21, 33.8, 6.23 },
-    {  9, 56, 21.89, -51, 20, 10.0, 6.37 },
-    { 22, 48, 33.31, -51, 19,   .8, 3.49 },
-    { 13, 18, 34.61, -51, 17, 10.0, 6.19 },
-    {  6, 46, 52.80, -51, 15, 56.9, 5.40 },
-    { 21,  0, 21.50, -51, 15, 55.1, 5.76 },
-    {  9, 34,  8.81, -51, 15, 19.1, 5.01 },
-    { 10, 13, 22.80, -51, 13, 59.9, 5.28 },
-    {  9, 43, 27.50, -51, 13, 41.9, 6.15 },
-    {  6,  0, 49.20, -51, 12, 59.0, 5.67 },
-    { 11,  6,  5.81, -51, 12, 45.0, 6.30 },
-    {  9,  7, 14.69, -51, 12, 42.8, 6.73 },
-    { 10, 16, 40.20, -51, 12, 18.0, 6.30 },
-    { 12, 57,  4.39, -51, 11, 55.0, 5.16 },
-    { 13, 29, 25.20, -51,  9, 55.1, 5.06 },
-    {  9, 53, 50.21, -51,  8, 48.8, 5.93 },
-    { 17,  1, 46.10, -51,  7, 50.9, 6.45 },
-    {  2, 33, 54.60, -51,  5, 37.0, 6.24 },
-    {  2, 22, 54.60, -51,  5, 31.9, 5.92 },
-    { 18, 17,   .91, -51,  4,  5.9, 6.06 },
-    {  5, 47, 17.11, -51,  3, 59.0, 3.85 },
-    {  9, 18,  5.81, -51,  3,  4.0, 5.26 },
-    { 19,  3, 57.41, -51,  1,  7.0, 5.93 },
-    {  7, 26, 21.89, -51,  1,  5.9, 5.10 },
-    { 13, 44, 15.91, -51,  0, 47.2, 6.47 },
-    {  0, 50, 41.21, -50, 59, 12.8, 5.22 },
-    {  8, 35, 52.10, -50, 58, 12.0, 5.80 },
-    { 11,  6, 27.41, -50, 57, 24.1, 6.32 },
-    { 23,  1,  7.49, -50, 57,   .0, 5.68 },
-    {  2, 54,  6.50, -50, 52, 17.0, 6.21 },
-    {  2, 10, 25.61, -50, 49, 27.8, 6.12 },
-    {  1, 46,  5.81, -50, 48, 59.0, 5.49 },
-    {  2, 42, 33.50, -50, 48,  1.1, 5.41 },
-    { 13, 42, 54.60, -50, 47, 26.2, 6.41 },
-    { 14, 23, 20.30, -50, 46, 19.9, 6.02 },
-    { 10, 57,  7.90, -50, 45, 54.0, 5.91 },
-    { 12,  8,  4.80, -50, 45, 47.9, 6.37 },
-    { 20, 54, 34.99, -50, 43, 40.1, 6.24 },
-    { 12,  8, 21.50, -50, 43, 21.0, 2.60 },
-    { 13, 13, 23.50, -50, 42,   .0, 5.89 },
-    { 23,  7, 14.69, -50, 41, 11.0, 5.83 },
-    { 16, 56,  8.90, -50, 40, 30.0, 6.33 },
-    { 12,  8,  5.21, -50, 39, 41.0, 4.47 },
-    { 16, 58, 18.00, -50, 38, 28.0, 5.55 },
-    { 17, 26,   .00, -50, 38,  1.0, 5.23 },
-    { 17, 27, 12.41, -50, 37, 49.1, 5.92 },
-    { 15, 52, 51.50, -50, 36, 55.1, 6.60 },
-    {  6, 49, 56.21, -50, 36, 52.9, 2.93 },
-    {  6, 54,  2.30, -50, 36, 42.1, 6.26 },
-    {  5, 19, 22.10, -50, 36, 22.0, 5.45 },
-    {  8,  4, 42.41, -50, 35, 26.2, 5.95 },
-    {  0, 28, 43.10, -50, 31, 58.1, 6.26 },
-    { 17, 42,  3.89, -50, 30, 38.2, 6.24 },
-    {  7, 50, 23.90, -50, 30, 34.9, 5.91 },
-    { 19, 12, 46.10, -50, 29, 11.0, 6.13 },
-    {  4, 42, 46.39, -50, 28, 53.0, 5.31 },
-    { 14, 32, 36.89, -50, 27, 24.8, 4.42 },
-    {  8, 15, 23.30, -50, 26, 57.8, 6.44 },
-    {  3, 32, 34.80, -50, 22, 43.0, 5.68 },
-    { 13, 59, 17.30, -50, 22, 12.0, 5.91 },
-    {  5, 54, 10.70, -50, 21, 42.8, 6.52 },
-    {  7,  5, 16.49, -50, 21, 37.1, 6.46 },
-    {  6, 18, 46.80, -50, 21, 33.1, 7.04 },
-    {  0,  1, 19.99, -50, 20, 13.9, 5.53 },
-    { 13, 47, 38.40, -50, 19, 16.0, 5.45 },
-    { 23, 20, 49.99, -50, 18, 24.1, 6.05 },
-    { 13, 47, 27.60, -50, 14, 57.8, 5.91 },
-    {  9, 54, 51.29, -50, 14, 38.0, 5.72 },
-    {  6, 29, 49.10, -50, 14, 21.1, 5.27 },
-    { 12, 28,  2.40, -50, 13, 50.2, 3.91 },
-    { 23, 47, 16.01, -50, 13, 36.1, 5.18 },
-    {  1, 50, 54.50, -50, 12, 22.0, 5.94 },
-    {  8, 13, 34.10, -50, 11, 46.0, 5.51 },
-    { 23, 27,  9.10, -50,  9, 25.9, 6.20 },
-    { 16, 19, 50.40, -50,  9, 20.2, 4.02 },
-    { 18, 46, 59.09, -50,  5, 39.8, 6.54 },
-    { 18,  6, 37.90, -50,  5, 30.1, 3.66 },
-    { 16, 17,   .91, -50,  4,  5.9, 4.99 },
-    { 17, 19, 30.31, -50,  3, 47.9, 6.27 },
-    { 17, 37, 27.19, -50,  3, 36.0, 5.93 },
-    { 16, 50, 35.90, -50,  2, 44.2, 6.47 },
-    {  1, 41, 41.09, -50,  2, 20.0, 6.64 },
-    { 20, 21, 40.99, -49, 59, 57.8, 6.27 },
-    {  7, 43,  6.89, -49, 59, 34.1, 6.57 },
-    {  7, 59, 12.29, -49, 58, 36.1, 6.32 },
-    {  7, 59, 13.39, -49, 58, 25.0, 6.34 },
-    { 13, 39, 59.69, -49, 57,  1.1, 6.00 },
-    {  8, 34, 43.61, -49, 56, 39.1, 5.01 },
-    { 21, 21, 16.39, -49, 56, 16.1, 6.38 },
-    { 12, 33, 59.21, -49, 54, 33.8, 6.38 },
-    { 13,  6, 54.60, -49, 54, 22.0, 4.27 },
-    {  2, 53, 52.90, -49, 53, 25.1, 4.00 },
-    { 18, 54, 32.30, -49, 52, 43.0, 6.60 },
-    { 17, 31, 50.50, -49, 52, 34.0, 2.95 },
-    { 13, 23, 52.30, -49, 49, 23.2, 6.48 },
-    {  8, 43, 40.30, -49, 49, 22.1, 5.16 },
-    { 11, 12, 56.90, -49, 44, 11.0, 6.11 },
-    {  1, 32, 36.31, -49, 43, 40.1, 6.28 },
-    { 22, 46, 28.30, -49, 41,  8.9, 6.48 },
-    { 16, 41, 40.20, -49, 39,  6.1, 5.65 },
-    {  5, 54, 41.09, -49, 37, 36.8, 6.10 },
-    { 23, 13, 15.00, -49, 37,  8.0, 6.80 },
-    {  7, 53,  3.70, -49, 36, 47.2, 4.63 },
-    { 23,  7,  9.50, -49, 36, 24.1, 6.33 },
-    {  7,  3, 53.69, -49, 35,  2.0, 4.93 },
-    {  5,  4, 58.01, -49, 34, 40.1, 5.03 },
-    { 16, 22, 28.01, -49, 34, 19.9, 5.33 },
-    {  6,  9, 23.30, -49, 33, 46.1, 6.49 },
-    { 13,  3, 33.19, -49, 31, 37.9, 4.85 },
-    { 14, 30, 20.90, -49, 31,  9.1, 5.37 },
-    { 21, 45, 19.01, -49, 29, 55.0, 6.45 },
-    { 15, 42, 37.20, -49, 29, 21.8, 6.04 },
-    { 14, 37, 53.21, -49, 25, 32.9, 4.05 },
-    {  9,  9, 45.10, -49, 25, 28.9, 6.48 },
-    { 10, 46, 46.20, -49, 25, 12.0, 2.69 },
-    { 17, 40, 23.59, -49, 24, 56.2, 4.77 },
-    { 10, 28,  1.90, -49, 24, 20.2, 6.10 },
-    { 11,  5,  4.20, -49, 23, 33.0, 6.13 },
-    { 13, 27, 20.81, -49, 22, 50.9, 6.28 },
-    {  9, 36, 49.61, -49, 21, 19.1, 4.35 },
-    { 20,  0, 25.30, -49, 21,  4.0, 6.17 },
-    {  7, 58, 14.40, -49, 14, 42.0, 4.41 },
-    { 16,  3, 12.91, -49, 13, 46.9, 4.65 },
-    {  5,  2, 48.60, -49,  9,  5.0, 5.38 },
-    { 13, 27,  6.29, -49,  8, 38.0, 6.31 },
-    { 11, 34, 56.81, -49,  8, 12.1, 5.50 },
-    { 11, 12, 33.10, -49,  6,  4.0, 5.36 },
-    { 15,  7, 25.90, -49,  5, 17.9, 5.77 },
-    {  0,  6, 19.01, -49,  4, 30.0, 5.70 },
-    {  1, 31, 15.10, -49,  4, 22.1, 3.95 },
-    { 18, 28, 49.90, -49,  4, 14.9, 4.13 },
-    { 11, 45, 12.60, -49,  4, 10.9, 6.26 },
-    { 14, 39, 24.70, -49,  3, 20.2, 6.39 },
-    {  9, 33, 44.50, -49,  0, 18.0, 5.12 },
-    {  8,  0, 14.90, -48, 58, 53.0, 6.02 },
-    { 22, 46,  7.99, -48, 58, 44.0, 6.62 },
-    { 12, 41, 31.01, -48, 57, 34.9, 2.17 },
-    { 13, 14, 43.10, -48, 57, 24.1, 5.89 },
-    { 12, 53,  6.89, -48, 56, 35.9, 4.33 },
-    {  7, 10, 47.50, -48, 55, 55.9, 5.14 },
-    {  8, 41,  5.30, -48, 55, 21.0, 5.90 },
-    { 12, 26, 48.19, -48, 54, 47.9, 6.26 },
-    { 15, 49, 57.50, -48, 54, 42.8, 5.84 },
-    { 17, 11, 38.90, -48, 52, 27.1, 5.84 },
-    {  8,  0, 28.90, -48, 52, 17.0, 6.12 },
-    { 14, 58,  8.81, -48, 51, 47.2, 6.35 },
-    {  7, 36, 43.90, -48, 49, 49.1, 5.72 },
-    { 12, 42, 35.40, -48, 48, 47.2, 4.66 },
-    {  0,  1,  4.51, -48, 48, 36.0, 5.71 },
-    {  0, 31, 25.01, -48, 48, 13.0, 4.77 },
-    { 16, 41, 20.30, -48, 45, 47.2, 5.65 },
-    {  9, 36, 25.30, -48, 45,  5.0, 6.17 },
-    { 15, 11, 57.60, -48, 44, 37.0, 5.69 },
-    {  6, 20,  6.10, -48, 44, 28.0, 6.60 },
-    { 15, 11, 56.09, -48, 44, 16.1, 3.87 },
-    {  3, 10, 27.41, -48, 44,  3.1, 6.12 },
-    {  6, 56, 16.01, -48, 43, 16.0, 4.95 },
-    { 12,  8, 14.69, -48, 41, 34.1, 5.34 },
-    {  8,  9,  9.60, -48, 41,  3.8, 5.70 },
-    { 17,  0, 27.10, -48, 38, 52.1, 6.00 },
-    {  7, 38, 18.19, -48, 36,  4.0, 5.68 },
-    { 22, 53, 37.90, -48, 35, 53.2, 6.04 },
-    {  8, 57, 55.80, -48, 34, 23.9, 5.87 },
-    { 13, 23,  2.59, -48, 33, 46.1, 6.38 },
-    { 12, 37, 42.19, -48, 32, 28.0, 3.86 },
-    {  8, 22, 31.61, -48, 29, 25.1, 4.82 },
-    { 13,  6, 16.70, -48, 27, 49.0, 4.71 },
-    {  8, 11, 11.09, -48, 27, 42.8, 5.82 },
-    { 12, 50, 19.61, -48, 27, 34.9, 6.24 },
-    {  6,  4, 46.90, -48, 27, 31.0, 6.58 },
-    {  9, 57, 42.50, -48, 24, 51.8, 6.05 },
-    { 18, 53,  2.50, -48, 21, 36.0, 6.19 },
-    {  8, 52, 38.59, -48, 21, 33.1, 5.91 },
-    { 14, 22, 38.71, -48, 19, 13.1, 6.09 },
-    { 15, 21, 48.19, -48, 19,  4.1, 5.65 },
-    { 19,  6, 55.61, -48, 17, 57.1, 5.97 },
-    {  6, 51, 32.81, -48, 17, 33.0, 6.42 },
-    { 13, 34, 28.90, -48, 16, 19.9, 6.33 },
-    {  7, 14, 38.21, -48, 16, 18.1, 4.76 },
-    { 10, 37, 18.10, -48, 13, 32.9, 3.84 },
-    {  6, 38, 37.61, -48, 13, 13.1, 4.93 },
-    { 15, 12, 31.30, -48, 13,  7.0, 6.33 },
-    {  0, 30, 26.09, -48, 12, 54.0, 5.69 },
-    {  6, 25, 43.61, -48, 10, 37.9, 5.76 },
-    { 15, 57,  3.79, -48,  9, 43.9, 6.31 },
-    { 18, 26, 53.90, -48,  7,   .8, 5.46 },
-    { 22,  9, 58.01, -48,  6, 25.9, 6.43 },
-    {  7, 53, 18.19, -48,  6, 11.2, 4.24 },
-    { 19, 35, 13.01, -48,  5, 57.1, 4.90 },
-    {  8, 42, 16.01, -48,  5, 57.1, 5.51 },
-    { 18, 41, 30.60, -48,  5, 42.0, 6.49 },
-    { 12, 52,  5.30, -48,  5, 39.1, 6.33 },
-    { 15, 15, 53.81, -48,  4, 27.1, 5.95 },
-    {  3, 44, 50.59, -48,  3, 41.0, 6.49 },
-    {  0, 35, 41.11, -48,  0,  2.9, 5.51 },
-    { 22, 56, 47.81, -47, 58,  9.1, 5.70 },
-    { 13, 22, 52.70, -47, 56, 35.2, 6.16 },
-    {  8,  9, 43.20, -47, 56, 15.0, 5.23 },
-    {  8, 29,  4.70, -47, 55, 45.1, 5.33 },
-    { 15, 22,  8.30, -47, 55, 40.1, 5.00 },
-    { 18, 39, 14.30, -47, 54, 34.9, 5.86 },
-    {  7, 57, 19.99, -47, 53, 25.1, 6.22 },
-    { 14, 56, 31.99, -47, 52, 45.1, 5.64 },
-    { 15, 18, 31.99, -47, 52, 30.0, 4.27 },
-    {  8, 31, 10.80, -47, 52,   .1, 6.39 },
-    {  1, 50, 20.21, -47, 48, 59.0, 6.14 },
-    {  3, 21, 33.29, -47, 46, 36.8, 6.39 },
-    {  3, 17, 26.59, -47, 45,  6.1, 5.85 },
-    { 11, 37, 33.91, -47, 44, 49.9, 5.44 },
-    { 15, 40, 58.30, -47, 44,  8.2, 6.23 },
-    { 20, 18, 55.99, -47, 42, 38.9, 6.31 },
-    {  2, 26, 59.11, -47, 42, 14.0, 4.25 },
-    { 10, 20, 16.70, -47, 41, 57.1, 5.65 },
-    { 11,  4, 31.20, -47, 40, 45.1, 5.67 },
-    {  6, 40, 49.30, -47, 40, 28.9, 6.65 },
-    { 11, 35, 55.61, -47, 38, 30.1, 5.25 },
-    { 20, 19, 17.90, -47, 34, 49.1, 6.13 },
-    { 19, 50, 13.80, -47, 33, 25.9, 5.94 },
-    { 16, 27, 11.09, -47, 33, 18.0, 4.47 },
-    {  0, 45, 45.60, -47, 33,  6.1, 5.80 },
-    {  8, 53, 50.69, -47, 31, 14.9, 5.33 },
-    { 18, 11,  4.49, -47, 30, 47.2, 6.07 },
-    { 17, 23, 16.10, -47, 28,  5.9, 5.25 },
-    { 14, 46, 29.09, -47, 26, 28.0, 5.74 },
-    { 14, 41, 55.80, -47, 23, 17.9, 2.30 },
-    {  1, 57, 10.01, -47, 23,  6.0, 4.83 },
-    {  3, 30, 37.01, -47, 22, 31.1, 5.99 },
-    { 11, 35, 13.20, -47, 22, 21.0, 5.71 },
-    { 16, 15, 15.31, -47, 22, 19.9, 5.14 },
-    { 10,  6, 11.30, -47, 22, 12.0, 5.08 },
-    {  3, 45, 15.79, -47, 21, 34.9, 5.73 },
-    {  8,  9, 29.30, -47, 20, 44.9, 4.27 },
-    {  9, 13, 34.51, -47, 20, 19.0, 5.92 },
-    {  8,  9, 31.99, -47, 20, 12.1, 1.78 },
-    {  8, 41, 13.10, -47, 19,   .8, 4.77 },
-    {  5, 36,  2.71, -47, 18, 50.0, 6.11 },
-    { 21, 48, 15.79, -47, 18, 13.0, 5.58 },
-    { 20, 37, 34.01, -47, 17, 29.0, 3.11 },
-    { 13, 55, 32.40, -47, 17, 17.9, 2.55 },
-    {  8, 58, 52.30, -47, 14,  4.9, 5.18 },
-    { 18, 29, 55.80, -47, 13, 13.1, 5.70 },
-    { 22, 42, 36.89, -47, 12, 38.2, 5.98 },
-    { 17,  3, 41.71, -47,  9, 36.0, 6.06 },
-    { 13, 53, 56.90, -47,  7, 41.2, 6.10 },
-    {  9,  4,  9.31, -47,  5, 52.1, 3.75 },
-    {  7, 48, 20.30, -47,  4, 40.1, 4.71 },
-    {  5, 30,  9.50, -47,  4, 40.1, 5.46 },
-    { 11, 56, 43.90, -47,  4, 21.0, 6.26 },
-    { 15, 51, 31.51, -47,  3, 38.2, 6.01 },
-    { 15,  5,  7.20, -47,  3,  4.0, 4.82 },
-    { 15,  5,  7.20, -47,  3,  4.0, 4.72 },
-    { 10, 32, 56.90, -47,  0, 11.9, 5.02 },
-    {  8, 13, 36.19, -46, 59, 30.8, 5.13 },
-    {  8,  5, 20.40, -46, 58, 44.0, 6.19 },
-    {  3,  2, 55.90, -46, 58, 30.0, 5.82 },
-    {  8, 33, 30.41, -46, 58, 16.0, 6.24 },
-    { 22,  8, 13.99, -46, 57, 40.0, 1.74 },
-    {  4, 27,  6.00, -46, 56, 51.0, 6.10 },
-    { 22, 46, 43.70, -46, 56, 21.8, 6.56 },
-    {  9, 50, 42.00, -46, 56,  3.8, 5.73 },
-    { 17, 41, 16.30, -46, 55, 18.8, 5.79 },
-    { 13, 51, 47.21, -46, 53, 57.1, 5.77 },
-    {  3, 53, 33.29, -46, 53, 37.0, 5.93 },
-    { 22, 42, 40.10, -46, 53,  4.9, 2.10 },
-    { 13, 20, 57.70, -46, 52, 50.2, 5.77 },
-    {  7, 49, 12.89, -46, 51, 28.1, 5.84 },
-    {  7, 14, 45.91, -46, 50, 58.9, 5.72 },
-    {  7, 16, 15.50, -46, 46, 27.8, 5.66 },
-    {  7, 12, 33.60, -46, 45, 33.8, 4.49 },
-    {  1, 29, 30.41, -46, 45, 23.0, 6.31 },
-    { 15, 29, 24.31, -46, 43, 58.1, 5.24 },
-    {  1,  6,  4.99, -46, 43,  7.0, 3.31 },
-    {  0, 48, 56.69, -46, 41, 52.1, 6.27 },
-    {  8, 40, 37.61, -46, 38, 56.0, 3.84 },
-    {  8, 12,   .00, -46, 38, 39.1, 5.76 },
-    { 23, 39, 28.01, -46, 38, 16.1, 6.09 },
-    { 10,  3, 20.50, -46, 38, 10.0, 6.12 },
-    { 17, 19,  3.19, -46, 38,  2.0, 5.48 },
-    { 21, 24, 20.81, -46, 36, 54.0, 6.31 },
-    {  6, 49, 54.60, -46, 36, 52.9, 5.14 },
-    {  7, 47, 31.49, -46, 36, 31.0, 5.23 },
-    {  5, 46, 27.41, -46, 35, 49.9, 5.31 },
-    { 18, 52, 27.10, -46, 35, 43.1, 5.54 },
-    { 13, 56, 19.51, -46, 35, 33.0, 5.83 },
-    { 18, 52, 59.59, -46, 35,  8.9, 6.19 },
-    { 14, 39, 10.99, -46, 35,  3.1, 6.07 },
-    {  9, 11, 33.19, -46, 35,  2.0, 5.79 },
-    {  9, 51, 40.80, -46, 32, 52.1, 4.58 },
-    { 22, 45, 40.70, -46, 32, 51.0, 5.51 },
-    {  8, 50, 33.50, -46, 31, 45.1, 5.10 },
-    {  2, 42,  8.50, -46, 31, 27.8, 6.10 },
-    {  4, 29, 19.99, -46, 30, 55.1, 6.16 },
-    { 17, 35, 39.60, -46, 30, 20.2, 4.59 },
-    { 13, 37, 23.71, -46, 25, 41.9, 5.90 },
-    {  1,  2, 49.20, -46, 23, 51.0, 5.36 },
-    {  7, 49, 14.30, -46, 22, 23.9, 4.11 },
-    {  8, 29, 45.60, -46, 19, 54.8, 5.99 },
-    {  1, 53, 38.81, -46, 18,  9.0, 4.41 },
-    {  2, 45, 16.49, -46, 17, 13.9, 6.85 },
-    {  8, 12, 30.91, -46, 15, 51.1, 6.03 },
-    { 14, 36, 19.01, -46, 14, 43.1, 5.55 },
-    { 16, 29, 42.31, -46, 14, 35.9, 5.35 },
-    { 20, 49, 28.99, -46, 13, 36.8, 4.89 },
-    {  9, 51, 19.80, -46, 11, 38.0, 5.62 },
-    {  8, 47, 18.91, -46,  9, 20.2, 5.75 },
-    { 12, 41, 22.99, -46,  8, 44.2, 5.84 },
-    { 14, 27, 12.19, -46,  8,  3.8, 5.83 },
-    { 14, 37, 20.11, -46,  8,  2.0, 5.41 },
-    {  0, 41, 19.61, -46,  5,  6.0, 4.59 },
-    { 16, 43,  3.41, -46,  4, 14.2, 6.23 },
-    { 14, 19, 24.19, -46,  3, 28.1, 3.55 },
-    {  9, 22, 24.00, -46,  2, 51.0, 5.75 },
-    {  8, 46,  1.70, -46,  2, 30.1, 3.91 },
-    { 17, 31, 49.10, -46,  2, 11.0, 6.03 },
-    { 18, 26, 58.39, -45, 58,  5.9, 3.51 },
-    { 18, 11, 13.80, -45, 57, 15.8, 4.53 },
-    { 22, 22, 43.90, -45, 56, 52.1, 6.62 },
-    { 22, 23,  7.99, -45, 55, 43.0, 5.62 },
-    {  5, 31, 36.10, -45, 55, 31.1, 5.86 },
-    { 18, 31, 45.41, -45, 54, 54.0, 4.96 },
-    {  8, 46, 30.60, -45, 54, 46.1, 5.46 },
-    { 11, 16, 27.70, -45, 52, 48.0, 6.31 },
-    {  4,  8, 33.91, -45, 51, 52.9, 6.59 },
-    { 17, 26, 51.50, -45, 50, 37.0, 5.29 },
-    {  8, 14, 23.90, -45, 50,  3.8, 5.83 },
-    {  5, 43, 41.09, -45, 49, 59.2, 6.39 },
-    { 18, 49, 27.41, -45, 48, 37.1, 5.81 },
-    {  6, 58, 41.81, -45, 46,  5.2, 6.22 },
-    { 18,  8, 30.10, -45, 46,  1.9, 6.15 },
-    { 18, 32,  1.99, -45, 45, 25.9, 5.07 },
-    {  0,  9, 24.70, -45, 44, 51.0, 3.88 },
-    {  9, 49, 57.10, -45, 43, 58.1, 5.08 },
-    { 12, 14,  2.59, -45, 43, 26.0, 5.31 },
-    { 11, 45, 43.90, -45, 41, 24.0, 5.29 },
-    { 14,  1, 43.39, -45, 36, 13.0, 4.34 },
-    { 17, 51, 44.50, -45, 36,  2.2, 6.11 },
-    {  7, 57, 51.79, -45, 34, 40.1, 5.17 },
-    {  1, 31, 39.10, -45, 34, 32.2, 6.17 },
-    {  9, 15, 14.59, -45, 33, 20.2, 6.25 },
-    {  1, 15, 11.09, -45, 31, 53.0, 4.96 },
-    { 17,  5,  5.30, -45, 30,  6.1, 6.28 },
-    { 23, 37, 51.00, -45, 29, 33.0, 4.74 },
-    { 19, 16, 21.70, -45, 27, 59.0, 5.40 },
-    {  8,  0, 19.61, -45, 27, 24.8, 6.61 },
-    { 17,  0, 32.30, -45, 27,  6.1, 6.65 },
-    {  6, 49, 57.79, -45, 27,   .0, 6.55 },
-    { 12, 11,  2.90, -45, 25, 22.1, 6.61 },
-    {  8, 41, 56.90, -45, 24, 38.9, 5.23 },
-    { 15, 50, 16.30, -45, 24,  6.1, 6.12 },
-    { 14, 26, 10.80, -45, 22, 45.8, 4.35 },
-    { 16, 24, 54.19, -45, 20, 57.1, 6.33 },
-    { 14, 30,  8.59, -45, 19, 18.1, 5.50 },
-    {  8, 49, 47.69, -45, 18, 29.2, 4.93 },
-    {  9, 54, 17.59, -45, 17,  2.0, 5.71 },
-    {  6, 10, 39.91, -45, 16, 54.8, 6.31 },
-    { 15,  8, 50.59, -45, 16, 46.9, 4.05 },
-    { 15, 11, 31.90, -45, 16, 45.8, 7.39 },
-    { 19, 39, 42.00, -45, 16, 41.2, 6.25 },
-    { 15, 11, 34.90, -45, 16, 39.0, 6.44 },
-    { 19, 33, 21.60, -45, 16, 18.8, 5.61 },
-    {  8,  6, 40.39, -45, 15, 59.0, 5.05 },
-    { 23, 10, 21.60, -45, 14, 48.1, 3.90 },
-    { 16, 35,  7.90, -45, 14, 40.9, 6.46 },
-    { 14, 26,  8.21, -45, 13, 17.0, 4.56 },
-    {  7, 59,  1.80, -45, 12, 58.0, 5.99 },
-    { 19, 14, 39.70, -45, 11, 35.9, 5.92 },
-    {  8, 40, 35.30, -45, 11, 29.0, 5.71 },
-    { 14, 20, 42.50, -45, 11, 13.9, 4.77 },
-    {  7, 13, 13.39, -45, 10, 59.2, 4.89 },
-    { 11, 51,  8.71, -45, 10, 25.0, 4.46 },
-    {  7, 42, 57.19, -45, 10, 23.9, 5.06 },
-    { 16,  6, 29.40, -45, 10, 23.9, 4.72 },
-    { 20,  0, 48.31, -45,  6, 47.2, 5.81 },
-    {  6,  7,  1.90, -45,  5, 29.0, 6.51 },
-    { 23, 44,  1.39, -45,  4, 59.9, 6.09 },
-    {  6,  4, 40.20, -45,  4, 44.0, 5.93 },
-    { 10, 31, 56.59, -45,  4,  9.8, 6.09 },
-    { 10, 31, 57.50, -45,  4,   .1, 5.74 },
-    {  8, 55, 19.30, -45,  2, 30.1, 6.26 },
-    {  6,  4, 28.39, -45,  2, 12.1, 6.35 },
-    { 21, 20,  9.50, -45,  1, 19.9, 6.00 },
-    { 14, 15, 38.81, -45,  0,  2.9, 6.31 },
-    { 15, 35, 53.21, -44, 57, 31.0, 4.54 },
-    {  4, 30, 50.09, -44, 57, 14.0, 5.07 },
-    {  9, 16,  4.20, -44, 53, 55.0, 6.04 },
-    {  5, 49, 34.10, -44, 52, 31.1, 6.38 },
-    {  9, 11,  4.39, -44, 52,  5.2, 5.00 },
-    { 21, 33, 23.50, -44, 50, 55.0, 5.57 },
-    { 23, 31, 27.00, -44, 50, 37.0, 6.02 },
-    { 13, 58, 40.80, -44, 48, 13.0, 3.87 },
-    { 19, 23, 13.20, -44, 47, 58.9, 4.29 },
-    {  0, 39, 52.01, -44, 47, 48.1, 6.01 },
-    {  9, 46, 30.41, -44, 45, 18.0, 5.55 },
-    {  7, 49, 28.20, -44, 45,  6.8, 6.32 },
-    {  8, 30, 39.19, -44, 44, 13.9, 6.30 },
-    {  8, 29, 27.60, -44, 43, 30.0, 4.99 },
-    {  2,  1, 42.41, -44, 42, 49.0, 5.14 },
-    { 15, 22, 40.90, -44, 41, 21.8, 3.37 },
-    { 12, 34, 42.31, -44, 40, 23.9, 5.77 },
-    { 15, 41, 11.30, -44, 39, 40.0, 4.64 },
-    { 11, 22, 23.11, -44, 38, 44.9, 6.12 },
-    {  7, 13, 32.40, -44, 38, 22.9, 5.10 },
-    {  7, 41, 21.79, -44, 37, 55.9, 6.41 },
-    { 10, 32, 33.60, -44, 37,  8.0, 5.91 },
-    {  7, 50, 42.41, -44, 34, 46.9, 6.45 },
-    { 17, 10, 42.29, -44, 33, 27.0, 5.08 },
-    {  1, 24, 41.90, -44, 31, 41.9, 6.26 },
-    { 20, 33, 55.10, -44, 30, 58.0, 5.11 },
-    { 15, 12, 49.51, -44, 30,  2.2, 4.82 },
-    { 23, 29,   .79, -44, 29, 52.1, 6.43 },
-    { 23, 16, 39.70, -44, 29, 21.1, 5.92 },
-    { 19, 22, 38.30, -44, 27, 32.0, 4.01 },
-    { 22, 15, 35.09, -44, 27,  6.8, 6.10 },
-    {  3, 12, 25.80, -44, 25, 10.9, 5.93 },
-    { 15, 36, 12.10, -44, 23, 48.8, 5.43 },
-    { 11, 13, 14.69, -44, 22, 19.9, 5.80 },
-    {  4, 12, 31.61, -44, 22,  5.9, 6.71 },
-    {  6,  8, 34.61, -44, 21, 22.0, 6.27 },
-    { 17, 56, 47.40, -44, 20, 31.9, 4.86 },
-    { 12,  8, 53.81, -44, 19, 34.0, 5.75 },
-    {  0,  0, 19.20, -44, 17, 26.2, 6.29 },
-    {  4, 19, 16.61, -44, 16,  5.2, 5.34 },
-    {  9, 16, 23.11, -44, 15, 56.9, 5.12 },
-    { 22, 42, 43.10, -44, 14, 52.1, 6.07 },
-    {  5, 24, 55.61, -44, 13, 32.9, 6.08 },
-    { 17, 19, 24.50, -44, 13, 23.2, 6.65 },
-    { 18, 15, 52.70, -44, 12, 24.1, 5.46 },
-    { 17, 24, 13.01, -44,  9, 45.0, 5.12 },
-    {  4, 25, 19.10, -44,  9, 38.9, 6.39 },
-    {  8, 29,  7.61, -44,  9, 38.2, 5.79 },
-    { 12, 54, 58.49, -44,  9,  6.8, 5.89 },
-    {  9, 14,  8.21, -44,  8, 44.9, 5.85 },
-    { 13, 37,  6.00, -44,  8, 35.9, 5.98 },
-    { 17, 18, 48.00, -44,  7, 46.9, 5.76 },
-    {  8,  9, 35.90, -44,  7, 22.1, 5.21 },
-    { 18, 24, 18.19, -44,  6, 37.1, 5.25 },
-    {  7, 57, 18.41, -44,  6, 34.9, 5.09 },
-    { 17,  5, 48.60, -44,  6, 18.0, 6.19 },
-    { 16, 34,  4.99, -44,  2, 43.1, 4.94 },
-    {  5, 58, 37.61, -44,  2,  3.8, 5.81 },
-    { 20, 48, 29.21, -43, 59, 19.0, 5.11 },
-    {  7, 18,  4.20, -43, 59, 12.1, 5.85 },
-    {  4, 48, 33.79, -43, 58, 48.0, 6.72 },
-    { 13, 17, 13.90, -43, 58, 45.8, 5.84 },
-    {  6, 52, 47.11, -43, 58, 32.9, 6.46 },
-    { 16, 22, 28.90, -43, 54, 43.9, 5.88 },
-    { 18, 29, 12.89, -43, 50, 44.9, 6.36 },
-    {  7, 55, 46.49, -43, 50, 42.0, 6.02 },
-    {  2, 10,  4.90, -43, 48, 56.2, 6.32 },
-    { 10, 59, 59.40, -43, 48, 25.9, 5.81 },
-    {  7, 45, 18.10, -43, 45,  7.9, 6.03 },
-    { 22, 29, 45.50, -43, 44, 57.8, 4.11 },
-    { 11, 14, 54.00, -43, 44,  3.1, 6.21 },
-    { 19, 24, 21.41, -43, 43, 23.2, 6.17 },
-    {  0, 51, 52.10, -43, 42, 33.1, 6.90 },
-    {  0, 26, 12.19, -43, 40, 48.0, 3.94 },
-    { 18, 48, 50.50, -43, 40, 48.0, 5.49 },
-    { 10, 35, 10.49, -43, 39, 52.9, 6.08 },
-    {  9, 12, 30.60, -43, 36, 49.0, 5.57 },
-    {  7,  3, 58.80, -43, 36, 42.1, 6.79 },
-    {  7,  3, 57.29, -43, 36, 29.2, 5.54 },
-    { 14, 51, 38.40, -43, 34, 32.2, 4.32 },
-    { 14, 47, 32.09, -43, 33, 27.0, 6.30 },
-    { 23,  6, 52.80, -43, 31, 14.2, 4.28 },
-    {  2,  9,  9.29, -43, 31,   .1, 5.85 },
-    { 18, 31, 56.21, -43, 30, 28.1, 5.72 },
-    {  7, 56, 57.89, -43, 30,  1.1, 5.35 },
-    { 22, 29, 16.20, -43, 29, 44.2, 3.97 },
-    { 15, 16, 10.49, -43, 29,  4.9, 6.04 },
-    { 14,  8, 51.89, -43, 28, 16.0, 6.17 },
-    { 19, 29, 23.90, -43, 26, 44.9, 5.71 },
-    { 18, 49, 34.99, -43, 26,  2.0, 5.61 },
-    {  9,  7, 59.81, -43, 25, 57.0, 2.21 },
-    { 18,  6, 49.80, -43, 25, 28.9, 5.77 },
-    { 18,  6, 49.80, -43, 25, 28.9, 5.77 },
-    {  7,  2, 15.60, -43, 24, 15.1, 6.43 },
-    { 16, 38, 26.21, -43, 23, 55.0, 5.83 },
-    {  0, 50,  3.70, -43, 23, 40.9, 6.48 },
-    { 13, 11, 23.21, -43, 22,  8.0, 5.25 },
-    {  1, 28, 21.89, -43, 19,  5.9, 3.41 },
-    {  7, 29, 13.80, -43, 18,  5.0, 3.25 },
-    { 17, 12,  9.19, -43, 14, 21.1, 3.33 },
-    {  0, 18, 42.60, -43, 14,  7.1, 6.33 },
-    {  9, 14, 24.50, -43, 13, 39.0, 5.25 },
-    {  2, 22, 11.81, -43, 12,   .0, 6.31 },
-    {  6, 37, 45.70, -43, 11, 46.0, 3.17 },
-    {  9, 38,  1.51, -43, 11, 28.0, 5.50 },
-    { 18, 39, 34.99, -43, 11, 10.0, 5.37 },
-    {  9,  0, 22.20, -43, 10, 23.9, 6.07 },
-    { 14, 59, 27.10, -43,  9, 36.0, 6.10 },
-    { 13, 13, 57.50, -43,  8, 20.0, 6.16 },
-    { 14, 58, 31.90, -43,  8,  2.0, 2.68 },
-    { 23, 23, 45.41, -43,  7, 27.8, 6.10 },
-    { 10, 15, 31.51, -43,  6, 45.0, 5.60 },
-    { 11, 41, 19.80, -43,  5, 44.9, 5.55 },
-    {  7, 51, 20.50, -43,  5, 44.2, 6.32 },
-    { 14,  6, 10.90, -43,  5, 30.8, 6.20 },
-    {  7, 33, 13.30, -43,  5, 11.0, 6.52 },
-    {  3, 19, 55.70, -43,  4, 10.9, 4.27 },
-    { 14, 20,  9.70, -43,  3, 32.0, 5.56 },
-    { 16, 53, 42.50, -43,  3,  2.9, 5.96 },
-    { 20,  0, 26.50, -43,  2, 35.9, 6.14 },
-    { 21,  2, 12.60, -43,  0,  6.8, 6.64 },
-    { 17, 37, 19.20, -42, 59, 52.1, 1.87 },
-    {  8, 37, 38.71, -42, 59, 21.1, 4.14 },
-    {  8, 11, 25.90, -42, 59, 13.9, 4.75 },
-    {  8,  3, 29.50, -42, 56, 55.0, 6.29 },
-    { 21, 34, 16.99, -42, 55, 30.0, 6.32 },
-    {  5, 53, 22.90, -42, 55, 17.0, 6.55 },
-    {  4,  7, 25.10, -42, 55,   .8, 6.59 },
-    { 12, 55, 19.39, -42, 54, 56.9, 5.47 },
-    { 16, 15, 24.00, -42, 53, 58.9, 6.14 },
-    {  2, 39, 48.00, -42, 53, 30.1, 4.75 },
-    {  7, 51, 40.30, -42, 53, 17.9, 6.04 },
-    { 17, 38,  8.50, -42, 52, 50.2, 6.10 },
-    { 15,  8, 39.10, -42, 52,  4.1, 5.85 },
-    { 23,  9, 57.29, -42, 51, 38.2, 5.81 },
-    { 16, 36, 22.51, -42, 51, 32.0, 5.47 },
-    {  5, 59,  8.81, -42, 48, 55.1, 3.96 },
-    { 20, 12, 23.90, -42, 46, 50.2, 6.22 },
-    {  8, 24, 57.19, -42, 46,  9.8, 5.98 },
-    { 10, 38, 50.30, -42, 45, 13.0, 6.11 },
-    { 10, 26,  9.50, -42, 44, 20.0, 6.13 },
-    { 17, 44, 42.00, -42, 43, 44.0, 5.87 },
-    { 18, 56, 16.90, -42, 42, 38.2, 5.36 },
-    { 13, 12, 50.90, -42, 41, 58.9, 6.22 },
-    {  0, 44, 57.10, -42, 40, 36.1, 5.94 },
-    { 11, 28, 35.11, -42, 40, 27.1, 5.08 },
-    { 16, 19, 17.69, -42, 40, 26.0, 5.45 },
-    { 11, 24, 22.10, -42, 40,  9.1, 6.12 },
-    {  8, 44, 24.00, -42, 38, 57.1, 4.07 },
-    {  8,  9, 47.71, -42, 38, 26.2, 6.26 },
-    { 11,  7, 16.61, -42, 38, 19.0, 5.15 },
-    {  3, 29, 55.01, -42, 38,  3.1, 5.78 },
-    { 23, 35,  4.61, -42, 36, 54.0, 4.71 },
-    { 15, 38,  3.19, -42, 34,  3.0, 4.33 },
-    { 21, 27,  1.61, -42, 32, 52.1, 5.51 },
-    { 12, 25,  8.50, -42, 30, 51.8, 6.11 },
-    {  8, 51, 27.91, -42, 30, 15.8, 6.55 },
-    {  6, 52, 39.70, -42, 30, 15.8, 6.52 },
-    {  1, 54, 22.01, -42, 29, 48.8, 5.11 },
-    { 16, 54, 26.90, -42, 28, 44.0, 5.88 },
-    { 13, 49, 37.01, -42, 28, 26.0, 3.04 },
-    { 10, 25, 17.21, -42, 28,  5.2, 6.18 },
-    {  8, 48,  8.81, -42, 27, 50.0, 6.43 },
-    { 12,  3, 39.60, -42, 26,  3.1, 5.15 },
-    { 20, 23, 53.21, -42, 25, 22.1, 5.64 },
-    {  7, 56, 57.89, -42, 24, 22.0, 6.09 },
-    {  6, 54, 26.71, -42, 21, 56.2, 6.32 },
-    { 16, 53, 59.69, -42, 21, 43.9, 4.73 },
-    { 16, 54, 34.99, -42, 21, 41.0, 3.62 },
-    {  7,  4,  2.81, -42, 20, 13.9, 5.20 },
-    { 14, 26, 13.39, -42, 19,  9.1, 6.32 },
-    { 18, 33, 30.19, -42, 18, 45.0, 4.64 },
-    {  0, 26, 16.99, -42, 18, 22.0, 2.39 },
-    {  6,  6, 40.99, -42, 17, 55.0, 6.12 },
-    {  4, 14,   .10, -42, 17, 39.8, 3.86 },
-    { 18, 18, 40.01, -42, 17, 17.9, 6.30 },
-    {  9, 13, 18.60, -42, 16, 25.0, 6.29 },
-    { 10, 55,  1.01, -42, 15,  4.0, 6.11 },
-    { 13, 11,  8.81, -42, 13, 59.2, 5.79 },
-    { 11,  0,  9.31, -42, 13, 32.9, 4.39 },
-    {  9, 21, 50.90, -42, 11, 42.0, 5.58 },
-    { 14, 35, 30.41, -42,  9, 28.1, 2.31 },
-    {  6,  7, 52.90, -42,  9, 14.0, 5.50 },
-    {  8, 25, 51.89, -42,  9, 11.9, 5.47 },
-    { 10, 14, 44.21, -42,  7, 18.8, 3.85 },
-    { 14, 59,  9.70, -42,  6, 15.1, 3.13 },
-    { 13, 58, 16.30, -42,  6,  2.9, 3.83 },
-    { 14, 34,  7.99, -42,  5, 58.9, 6.60 },
-    { 19,  3,  6.89, -42,  5, 43.1, 4.75 },
-    {  8, 50, 21.00, -42,  5, 24.0, 6.00 },
-    { 13, 43, 40.01, -42,  4,  3.0, 5.98 },
-    { 20, 22, 27.50, -42,  2, 58.9, 5.59 },
-    {  1, 59, 38.81, -42,  1, 50.2, 5.57 },
-    { 19, 22,  9.60, -42,  0, 58.0, 6.34 },
-    { 17, 52, 52.70, -41, 59, 48.1, 6.20 },
-    { 16, 53, 58.80, -41, 59, 40.9, 6.32 },
-    {  4, 10, 50.59, -41, 59, 37.0, 4.93 },
-    {  4, 28,  9.41, -41, 57, 36.0, 6.44 },
-    { 10, 23, 40.39, -41, 57, 11.9, 6.27 },
-    { 18, 31,  3.00, -41, 54, 49.0, 6.04 },
-    { 12, 15, 30.50, -41, 54, 47.2, 6.26 },
-    { 19,  2,  8.71, -41, 54, 36.0, 6.23 },
-    { 19,  9, 57.79, -41, 53, 33.0, 5.88 },
-    { 19, 55, 15.70, -41, 52,  5.9, 4.13 },
-    {  9,  1, 20.81, -41, 51, 51.8, 5.55 },
-    {  4, 40, 33.70, -41, 51, 50.0, 4.45 },
-    { 16, 52, 19.10, -41, 51, 15.8, 6.49 },
-    { 16, 54, 11.81, -41, 51,  1.1, 6.45 },
-    {  2, 19, 24.70, -41, 50, 53.9, 6.37 },
-    { 14, 14, 42.60, -41, 50, 15.0, 5.61 },
-    { 16, 54, 19.61, -41, 49, 12.0, 6.59 },
-    { 15, 44, 22.61, -41, 49,  9.8, 5.94 },
-    { 16, 31, 41.71, -41, 49,   .8, 5.33 },
-    { 16, 54,  1.80, -41, 48, 23.0, 5.45 },
-    {  1, 47, 16.80, -41, 45, 36.0, 6.18 },
-    {  5,  3, 54.00, -41, 44, 42.0, 6.31 },
-    { 15, 59, 30.31, -41, 44, 39.8, 4.99 },
-    {  8, 47, 40.49, -41, 44, 13.9, 6.36 },
-    { 12, 29, 57.91, -41, 44, 10.0, 6.02 },
-    { 17, 57, 47.71, -41, 42, 58.0, 4.88 },
-    { 10, 10, 37.90, -41, 42, 54.0, 5.98 },
-    { 13, 49, 30.31, -41, 41, 16.1, 3.41 },
-    { 10, 18, 28.20, -41, 40,  5.9, 5.96 },
-    { 10, 22, 19.61, -41, 39,   .0, 4.83 },
-    {  3, 26, 11.71, -41, 38, 12.8, 6.32 },
-    { 22, 16, 26.59, -41, 37, 39.0, 5.10 },
-    { 13,  6, 35.11, -41, 35, 19.0, 5.59 },
-    {  6, 36, 51.31, -41, 33, 24.8, 6.34 },
-    { 14, 35, 31.51, -41, 31,  1.9, 5.87 },
-    { 13, 26, 56.09, -41, 29, 53.2, 5.69 },
-    {  1, 24, 40.80, -41, 29, 33.0, 5.42 },
-    { 15, 16,  4.01, -41, 29, 28.0, 5.16 },
-    {  1,  7, 47.90, -41, 29, 12.8, 5.21 },
-    { 23,  3, 59.50, -41, 28, 41.9, 5.79 },
-    {  7, 14, 57.10, -41, 25, 32.9, 5.94 },
-    { 14,  3, 27.50, -41, 25, 23.9, 6.11 },
-    { 22, 43, 30.00, -41, 24, 51.8, 4.85 },
-    { 13, 42, 55.01, -41, 24,  4.0, 5.98 },
-    { 21,  6, 25.51, -41, 23, 10.0, 5.53 },
-    { 12, 24, 44.69, -41, 23,  3.1, 6.25 },
-    { 22, 14, 38.59, -41, 22, 54.1, 6.23 },
-    {  3, 30, 13.61, -41, 22, 12.0, 6.12 },
-    { 18, 11,  5.59, -41, 21, 33.1, 5.86 },
-    { 22, 15, 36.89, -41, 20, 48.1, 4.79 },
-    { 18, 13, 12.60, -41, 20, 10.0, 5.47 },
-    {  4, 50, 16.20, -41, 19, 14.9, 6.07 },
-    {  8,  2, 44.81, -41, 18, 36.0, 5.52 },
-    {  9,  0,  5.40, -41, 15, 14.0, 4.45 },
-    { 12,  8, 54.50, -41, 13, 53.0, 5.48 },
-    { 16, 51, 33.70, -41, 13, 50.2, 5.22 },
-    { 13,  4, 48.10, -41, 11, 48.1, 6.26 },
-    { 23, 16, 49.80, -41, 11, 39.8, 6.47 },
-    { 14,  6,  2.81, -41, 10, 46.9, 4.36 },
-    { 21, 32,  5.90, -41, 10, 45.1, 5.29 },
-    { 17, 33,  7.39, -41, 10, 25.0, 5.84 },
-    { 15, 35,  8.50, -41, 10,   .8, 2.78 },
-    {  2, 14, 31.99, -41, 10,   .1, 5.91 },
-    { 16, 54, 58.39, -41,  9,  4.0, 5.77 },
-    {  8, 46, 23.81, -41,  7, 32.2, 6.21 },
-    { 16, 11, 17.69, -41,  7, 10.9, 5.86 },
-    { 16, 43, 45.50, -41,  7,  8.0, 6.20 },
-    { 16, 43, 53.90, -41,  6, 47.2, 6.12 },
-    { 23, 14, 58.61, -41,  6, 20.2, 5.77 },
-    {  6, 28, 42.29, -41,  4, 27.8, 6.32 },
-    { 15,  5, 19.10, -41,  4,  1.9, 5.15 },
-    {  4, 43, 44.21, -41,  3, 52.9, 6.25 },
-    { 15, 18,  9.41, -41,  3, 38.9, 6.28 },
-    { 12, 35, 45.50, -41,  1, 18.8, 5.13 },
-    { 21, 24, 24.79, -41,  0, 24.1, 5.77 },
-    { 11, 58, 20.30, -40, 56, 49.9, 6.79 },
-    {  5, 27,  5.30, -40, 56, 37.0, 5.87 },
-    {  0, 30, 27.79, -40, 56, 21.8, 6.19 },
-    {  7, 43, 41.90, -40, 56,  2.0, 5.17 },
-    {  6, 30, 59.81, -40, 54, 59.0, 6.20 },
-    {  7,  7,  7.10, -40, 53, 35.9, 5.79 },
-    { 15,  4, 42.91, -40, 51, 41.0, 6.41 },
-    { 14, 30, 56.50, -40, 50, 42.0, 6.39 },
-    {  2, 24, 33.79, -40, 50, 26.2, 6.18 },
-    { 16, 44, 42.60, -40, 50, 22.9, 5.71 },
-    {  9, 56,  5.40, -40, 49, 28.9, 6.41 },
-    { 23, 18,  9.91, -40, 49, 27.8, 5.53 },
-    { 16, 56, 36.00, -40, 49, 25.0, 6.15 },
-    { 20,  1, 26.40, -40, 48, 51.1, 6.29 },
-    { 21, 20, 45.60, -40, 48, 34.9, 4.82 },
-    { 20, 25, 47.90, -40, 47, 47.0, 6.09 },
-    { 15, 18, 56.40, -40, 47, 17.9, 5.59 },
-    { 17, 51, 32.81, -40, 46, 21.0, 5.96 },
-    { 15, 21, 35.30, -40, 44, 58.9, 6.20 },
-    {  7, 56, 24.29, -40, 44, 11.0, 6.78 },
-    {  5, 38, 43.61, -40, 42, 27.0, 5.82 },
-    {  3, 44,  6.19, -40, 39, 37.1, 6.45 },
-    { 15, 59, 58.01, -40, 39, 10.1, 6.49 },
-    {  5, 47, 58.10, -40, 39,  9.0, 6.61 },
-    {  7, 48,  8.50, -40, 39,  7.9, 6.14 },
-    {  9, 32, 19.30, -40, 38, 57.8, 5.35 },
-    { 15, 21, 22.30, -40, 38, 51.0, 3.22 },
-    { 19, 23, 53.21, -40, 36, 58.0, 3.97 },
-    { 23, 10,  9.79, -40, 35, 30.1, 5.83 },
-    { 22, 36, 58.80, -40, 35, 28.0, 5.86 },
-    { 11, 33, 37.30, -40, 35, 12.8, 5.39 },
-    { 15,  8, 12.10, -40, 35,  2.0, 5.79 },
-    { 22, 36, 29.30, -40, 34, 58.1, 6.28 },
-    {  7, 52, 13.01, -40, 34, 32.9, 3.73 },
-    {  2, 43, 20.30, -40, 31, 39.0, 6.36 },
-    { 21, 15, 14.69, -40, 30, 23.0, 6.21 },
-    {  9, 26, 28.49, -40, 30,  6.8, 6.20 },
-    { 11, 46, 31.10, -40, 30,  2.2, 4.91 },
-    {  7, 12, 15.79, -40, 29, 56.0, 5.31 },
-    { 19,  8, 20.90, -40, 29, 48.1, 4.59 },
-    {  9, 30, 42.00, -40, 28,   .1, 3.60 },
-    {  8, 53, 50.69, -40, 26, 51.0, 6.47 },
-    { 11, 32, 48.10, -40, 26, 11.0, 5.64 },
-    { 16,  0, 53.71, -40, 26,  7.1, 6.21 },
-    { 18, 47, 44.59, -40, 24, 22.0, 5.24 },
-    {  4, 13, 35.71, -40, 21, 28.1, 6.37 },
-    {  3, 54, 23.21, -40, 21, 25.9, 5.71 },
-    {  6, 10, 10.30, -40, 21, 13.0, 5.58 },
-    {  6, 41, 14.09, -40, 20, 58.9, 6.12 },
-    {  8, 14,  2.90, -40, 20, 53.2, 4.44 },
-    { 10, 13, 45.91, -40, 20, 44.9, 5.90 },
-    {  8, 49, 39.19, -40, 19, 14.2, 5.48 },
-    { 10, 13, 56.59, -40, 18, 38.2, 6.35 },
-    { 17, 56, 55.80, -40, 18, 20.2, 6.43 },
-    {  2, 58, 15.70, -40, 18, 16.9, 3.24 },
-    {  2, 58, 16.30, -40, 18, 15.8, 4.35 },
-    { 23, 54, 38.59, -40, 18,   .0, 6.03 },
-    {  6, 24, 44.50, -40, 17,  3.1, 6.31 },
-    {  3, 37,  5.71, -40, 16, 28.9, 4.58 },
-    { 21, 12, 13.61, -40, 16,  9.8, 5.83 },
-    {  8, 40, 19.30, -40, 15, 51.1, 5.20 },
-    { 14,  1, 19.01, -40, 13, 19.9, 6.13 },
-    { 14, 36, 44.21, -40, 12, 42.1, 5.74 },
-    { 15, 47, 25.39, -40, 11, 39.1, 6.42 },
-    { 23, 46,  1.20, -40, 10, 57.0, 6.31 },
-    { 12, 53, 26.21, -40, 10, 44.0, 4.27 },
-    { 12, 43, 26.30, -40, 10, 40.1, 6.44 },
-    { 13, 27, 14.69, -40,  9, 47.2, 6.40 },
-    {  8, 37, 19.90, -40,  8, 51.0, 6.55 },
-    { 17, 47, 35.09, -40,  7, 36.8, 3.03 },
-    { 17, 50, 11.21, -40,  5, 26.2, 4.81 },
-    { 15, 34,  1.61, -40,  3, 58.0, 5.82 },
-    {  7, 46, 33.41, -40,  3, 34.9, 6.57 },
-    {  7, 33, 13.51, -40,  3, 32.0, 6.26 },
-    { 13, 39, 48.60, -40,  3,  6.8, 5.60 },
-    { 19, 34,  8.50, -40,  2,  4.9, 5.89 },
-    {  8,  3, 35.09, -40,  0, 11.9, 2.25 },
-    {  7, 38, 24.19, -39, 59, 29.0, 6.59 },
-    { 12, 39, 52.51, -39, 59, 15.0, 4.64 },
-    { 10,  4, 23.40, -39, 58, 32.9, 6.43 },
-    {  8, 35, 12.60, -39, 58, 12.0, 6.47 },
-    {  5, 54, 52.51, -39, 57, 29.2, 5.57 },
-    {  2, 50, 47.90, -39, 55, 54.1, 6.36 },
-    {  0, 28, 26.40, -39, 54, 54.0, 5.43 },
-    { 14, 58, 36.79, -39, 54, 24.1, 6.15 },
-    {  7, 33, 58.51, -39, 54, 20.9, 6.76 },
-    { 13, 50, 19.39, -39, 54,  4.0, 6.44 },
-    { 18, 33,   .91, -39, 53, 31.9, 6.22 },
-    { 19, 51, 50.59, -39, 52, 27.8, 5.33 },
-    { 14, 26, 49.90, -39, 52, 26.0, 6.35 },
-    { 12, 36,  1.20, -39, 52, 12.0, 5.80 },
-    { 15, 56,  6.50, -39, 51, 51.1, 6.03 },
-    {  2, 40, 40.01, -39, 51, 20.2, 4.11 },
-    { 19,  9, 39.70, -39, 49, 41.2, 6.46 },
-    { 18, 57, 34.70, -39, 49, 23.9, 6.31 },
-    { 20, 53, 40.20, -39, 48, 36.0, 5.35 },
-    {  9, 22, 36.70, -39, 46, 28.9, 6.54 },
-    { 17, 14, 27.70, -39, 46,   .8, 6.60 },
-    { 13, 26,  7.80, -39, 45, 19.1, 5.09 },
-    { 13, 39, 40.80, -39, 44, 53.2, 6.27 },
-    {  5,  1, 34.51, -39, 43,  5.2, 6.03 },
-    { 15, 24, 44.90, -39, 42, 37.1, 5.37 },
-    { 18, 32, 21.41, -39, 42, 14.0, 5.16 },
-    { 11, 55, 54.70, -39, 41, 21.1, 6.13 },
-    { 18, 44, 57.19, -39, 41, 11.0, 5.43 },
-    { 12, 51, 56.81, -39, 40, 50.9, 5.98 },
-    {  5, 23, 24.00, -39, 40, 43.0, 5.71 },
-    {  7,  8, 51.10, -39, 39, 20.9, 4.83 },
-    {  4, 54, 54.79, -39, 37, 43.0, 6.10 },
-    {  8, 21, 24.19, -39, 37, 14.9, 6.16 },
-    {  8, 11, 21.50, -39, 37,  7.0, 4.45 },
-    {  9, 38, 40.70, -39, 36, 51.1, 6.70 },
-    { 14, 36, 24.19, -39, 35, 49.9, 6.13 },
-    {  9, 44, 15.79, -39, 34, 16.0, 6.82 },
-    { 10, 35, 12.91, -39, 33, 46.1, 5.38 },
-    { 20, 42, 52.99, -39, 33, 31.0, 6.29 },
-    { 22,  6,  6.89, -39, 32, 35.9, 4.46 },
-    {  6, 46,  3.29, -39, 32, 24.0, 6.62 },
-    { 18, 59, 11.11, -39, 32,  4.9, 6.49 },
-    { 14, 23,  2.21, -39, 30, 43.9, 4.42 },
-    { 17, 12, 16.20, -39, 30, 24.8, 5.67 },
-    { 19, 39, 55.70, -39, 25, 59.9, 6.61 },
-    { 16, 20, 32.59, -39, 25, 50.9, 6.12 },
-    {  9, 24, 16.30, -39, 25, 32.9, 6.06 },
-    { 21, 13,  3.10, -39, 25, 31.1, 5.26 },
-    { 14, 56, 35.81, -39, 24, 58.0, 6.36 },
-    { 13, 31,  2.69, -39, 24, 27.0, 3.88 },
-    {  5, 43, 30.19, -39, 24, 24.8, 6.25 },
-    {  9,  2,  6.41, -39, 24,  9.0, 6.27 },
-    {  9, 16, 57.19, -39, 24,  5.0, 5.33 },
-    { 16, 46, 47.81, -39, 22, 37.9, 5.48 },
-    {  4, 45, 55.39, -39, 21, 24.1, 6.05 },
-    { 15, 34, 20.90, -39, 20, 57.8, 6.36 },
-    { 19, 10,  1.70, -39, 20, 26.9, 4.11 },
-    {  7, 47,  5.81, -39, 19, 53.0, 6.31 },
-    { 12, 23, 36.89, -39, 18, 11.2, 6.40 },
-    {  7, 59, 28.39, -39, 17, 49.9, 5.24 },
-    {  6, 16, 35.59, -39, 15, 51.8, 6.00 },
-    {  9, 11, 40.99, -39, 15, 32.0, 6.00 },
-    {  7, 18, 33.60, -39, 12, 37.1, 5.25 },
-    { 20, 46, 20.09, -39, 11, 57.1, 5.50 },
-    {  6, 43, 23.30, -39, 11, 35.9, 6.30 },
-    { 16, 24,  1.30, -39, 11, 35.2, 5.40 },
-    { 15, 38, 32.69, -39,  9, 38.9, 6.57 },
-    { 22, 51,  2.21, -39,  9, 24.8, 5.42 },
-    {  8, 49, 52.39, -39,  8, 30.1, 6.39 },
-    { 17, 57, 57.79, -39,  8, 12.8, 6.29 },
-    { 22, 28, 39.19, -39,  7, 54.8, 5.47 },
-    {  9, 33,  7.80, -39,  7, 44.0, 6.43 },
-    { 15, 38, 42.31, -39,  7, 41.2, 6.04 },
-    { 16,  8, 34.20, -39,  6, 19.1, 7.05 },
-    { 16,  8, 34.39, -39,  5, 35.2, 6.65 },
-    {  8, 31, 24.60, -39,  3, 51.1, 6.31 },
-    {  8, 26, 18.19, -39,  3, 37.1, 7.25 },
-    {  8, 26, 17.59, -39,  3, 33.8, 6.53 },
-    { 12, 28, 22.51, -39,  2, 29.0, 5.44 },
-    { 17, 42, 29.30, -39,  1, 48.0, 2.41 },
-    { 19, 11,  1.80, -39,  0, 18.0, 6.36 },
-    { 18, 28, 27.10, -38, 59, 44.2, 5.64 },
-    { 12, 13, 25.30, -38, 55, 45.1, 5.76 },
-    {  1,  1, 18.31, -38, 55,   .1, 5.59 },
-    { 12, 23, 44.90, -38, 54, 40.0, 5.79 },
-    { 23,  6, 53.59, -38, 53, 31.9, 5.61 },
-    { 14, 31, 10.80, -38, 52, 10.9, 5.97 },
-    {  7, 43,  7.01, -38, 51, 51.1, 6.89 },
-    {  7, 52, 38.69, -38, 51, 47.2, 4.49 },
-    { 18, 29, 16.80, -38, 51,  4.0, 6.63 },
-    {  8, 33, 38.30, -38, 50, 56.0, 5.96 },
-    { 17, 12, 16.51, -38, 49, 19.9, 6.30 },
-    {  7, 29,  5.71, -38, 48, 43.9, 5.43 },
-    { 14, 38, 19.61, -38, 47, 39.1, 6.02 },
-    { 15, 10,  7.49, -38, 47, 33.0, 5.98 },
-    {  7, 38, 32.59, -38, 46, 52.0, 6.19 },
-    { 15, 25, 20.21, -38, 44,  1.0, 4.60 },
-    { 18, 33, 23.11, -38, 43, 34.0, 5.65 },
-    {  8, 52, 48.00, -38, 43, 27.1, 5.82 },
-    { 18, 33, 23.30, -38, 43, 13.1, 6.32 },
-    { 18, 22, 18.60, -38, 39, 24.8, 5.10 },
-    { 17, 36, 32.81, -38, 38,  7.1, 4.29 },
-    { 21,  2, 58.01, -38, 37, 54.1, 5.30 },
-    {  6, 33, 10.30, -38, 37, 31.1, 6.44 },
-    { 15, 32,  4.39, -38, 37, 23.2, 6.25 },
-    {  9, 13, 25.90, -38, 36, 59.0, 6.31 },
-    { 16,  3, 24.19, -38, 36,  9.0, 4.89 },
-    {  1, 53, 23.21, -38, 35, 40.9, 6.10 },
-    { 17, 15, 35.90, -38, 35, 38.0, 5.96 },
-    {  9, 15, 36.70, -38, 34, 12.0, 4.94 },
-    { 21, 44, 29.50, -38, 33,  9.0, 6.30 },
-    {  7, 41, 15.79, -38, 32,  1.0, 5.42 },
-    { 21,  2, 27.19, -38, 31, 50.2, 5.94 },
-    {  7, 41, 58.01, -38, 31, 44.0, 6.54 },
-    {  5, 52, 47.71, -38, 31, 32.9, 6.70 },
-    { 17, 29, 25.70, -38, 31,   .1, 6.39 },
-    {  5, 32, 51.31, -38, 30, 47.2, 5.48 },
-    {  7, 47, 25.01, -38, 30, 40.0, 5.08 },
-    {  0, 42, 42.91, -38, 27, 47.9, 6.06 },
-    {  2, 53, 34.39, -38, 26, 12.8, 5.92 },
-    {  0, 44, 12.10, -38, 25, 18.1, 5.90 },
-    {  9, 29, 16.30, -38, 24, 14.0, 6.19 },
-    {  1, 49, 48.79, -38, 24, 14.0, 6.37 },
-    { 13, 32,  5.30, -38, 23, 57.1, 6.16 },
-    {  6, 42, 16.39, -38, 23, 55.0, 6.29 },
-    { 16,  0,  7.30, -38, 23, 48.8, 3.41 },
-    { 21, 59, 17.90, -38, 23, 43.1, 5.50 },
-    {  2, 42,  6.60, -38, 23,  2.0, 6.01 },
-    {  7,  6,  2.30, -38, 22, 58.1, 6.11 },
-    {  8, 33, 19.90, -38, 22, 16.0, 6.49 },
-    { 18, 43, 46.90, -38, 19, 25.0, 5.13 },
-    {  7, 16, 31.80, -38, 19,  8.0, 5.80 },
-    {  7, 39, 27.41, -38, 18, 29.9, 4.84 },
-    { 14, 47,  5.11, -38, 17, 26.9, 5.94 },
-    {  8, 23, 17.21, -38, 17,  8.9, 6.32 },
-    {  7, 39, 47.81, -38, 15, 38.9, 5.76 },
-    { 19,  3, 17.71, -38, 15, 11.9, 5.74 },
-    { 22, 47, 47.11, -38, 13, 18.8, 6.71 },
-    { 15, 21, 30.10, -38, 13,  9.1, 6.48 },
-    {  7, 43, 42.89, -38, 12,  6.8, 6.40 },
-    {  2, 57, 32.69, -38, 11, 28.0, 6.41 },
-    { 15, 25,  6.60, -38, 10,  9.8, 7.03 },
-    {  6, 39, 56.90, -38,  9, 32.0, 6.58 },
-    { 16, 43, 47.59, -38,  9, 24.1, 6.05 },
-    { 17,  3, 50.81, -38,  9,  7.9, 5.91 },
-    {  6, 37,  1.90, -38,  8, 48.1, 6.04 },
-    {  7, 39, 43.80, -38,  8, 21.8, 5.73 },
-    {  1, 41, 27.31, -38,  7, 59.2, 6.17 },
-    { 17, 47,  7.30, -38,  6, 42.1, 6.43 },
-    { 20, 34, 55.51, -38,  5, 22.9, 6.44 },
-    { 17, 37, 26.81, -38,  3, 56.2, 6.26 },
-    { 19, 57, 41.30, -38,  3, 29.9, 6.55 },
-    { 15,  1, 13.01, -38,  3, 29.9, 5.89 },
-    { 16, 51, 52.20, -38,  2, 51.0, 3.08 },
-    { 16, 52, 20.11, -38,  1,  3.0, 3.57 },
-    { 11, 17, 11.81, -38,  0, 51.8, 6.27 },
-    {  7, 37, 45.19, -38,  0, 38.2, 6.38 },
-    { 10, 23, 29.30, -38,  0, 36.0, 5.33 },
-    {  2, 38, 24.79, -37, 59, 26.2, 6.49 },
-    {  7, 45, 15.31, -37, 58,  7.0, 3.61 },
-    {  7, 44, 34.20, -37, 56, 35.2, 5.88 },
-    { 20,  3, 33.50, -37, 56, 26.9, 4.77 },
-    {  7, 46, 10.39, -37, 56,  2.0, 5.88 },
-    {  6, 47, 21.41, -37, 55, 46.9, 5.26 },
-    {  8, 12, 51.50, -37, 55, 27.8, 6.43 },
-    { 15, 47, 28.99, -37, 54, 59.0, 6.01 },
-    { 20, 51,   .70, -37, 54, 47.9, 5.52 },
-    { 19,  9, 28.30, -37, 54, 15.8, 4.11 },
-    {  6, 27,  7.49, -37, 53, 44.2, 6.48 },
-    {  7, 45,  4.61, -37, 53, 16.1, 6.54 },
-    { 14, 20, 33.41, -37, 53,  7.1, 4.05 },
-    { 14, 59, 13.90, -37, 52, 53.0, 6.47 },
-    { 12, 10, 33.79, -37, 52, 13.1, 6.06 },
-    { 16,  4, 36.70, -37, 51, 47.2, 5.90 },
-    {  1, 12, 45.41, -37, 51, 23.0, 5.92 },
-    { 21, 26, 22.90, -37, 49, 45.8, 5.63 },
-    { 23, 32, 58.30, -37, 49,  5.9, 4.37 },
-    {  7, 28, 22.80, -37, 48, 37.1, 6.58 },
-    { 19,  6, 52.51, -37, 48, 37.1, 6.16 },
-    { 17, 22, 39.41, -37, 48, 18.0, 6.41 },
-    { 14, 52, 51.10, -37, 48, 11.9, 5.03 },
-    { 13, 12,  3.19, -37, 48, 11.2, 4.85 },
-    { 14, 41, 57.60, -37, 47, 37.0, 4.00 },
-    {  6, 46, 12.10, -37, 46, 32.2, 6.21 },
-    {  9, 23, 44.81, -37, 45, 25.9, 6.48 },
-    { 11, 54, 25.80, -37, 44, 56.0, 6.46 },
-    { 11, 25, 33.10, -37, 44, 52.1, 5.89 },
-    { 21, 57,  2.21, -37, 44, 48.8, 6.18 },
-    {  6, 17,  1.20, -37, 44, 15.0, 5.53 },
-    { 20,  0, 15.91, -37, 42,  7.9, 5.95 },
-    {  6, 32, 21.31, -37, 41, 48.1, 5.24 },
-    {  8,  8, 37.61, -37, 40, 53.0, 6.37 },
-    {  5, 52, 33.19, -37, 37, 52.0, 5.63 },
-    {  3, 48, 35.40, -37, 37, 19.9, 5.40 },
-    { 16, 58, 52.39, -37, 37, 16.0, 6.09 },
-    {  3, 48, 35.90, -37, 37, 14.2, 4.73 },
-    {  8, 34, 29.30, -37, 36, 41.0, 6.30 },
-    {  9, 14, 57.19, -37, 36,  9.0, 5.86 },
-    { 19, 12,  9.79, -37, 34, 58.1, 6.57 },
-    {  9, 20, 29.59, -37, 34, 53.0, 6.05 },
-    {  7, 39, 58.01, -37, 34, 45.8, 6.00 },
-    {  2, 23,  6.50, -37, 34, 35.0, 6.53 },
-    { 16, 24, 31.70, -37, 33, 56.9, 5.42 },
-    { 19, 43, 37.61, -37, 32, 20.0, 6.16 },
-    { 16, 50, 59.81, -37, 30, 51.8, 6.11 },
-    { 15, 58, 30.70, -37, 30, 11.2, 6.31 },
-    { 18, 20, 55.30, -37, 29, 15.0, 6.45 },
-    { 17, 35, 43.01, -37, 26, 24.0, 6.48 },
-    { 15, 42, 38.30, -37, 25, 30.0, 5.24 },
-    {  9, 15, 45.10, -37, 24, 47.9, 4.62 },
-    { 20, 26, 52.99, -37, 24, 11.2, 6.25 },
-    {  5, 11, 35.90, -37, 23, 43.1, 6.57 },
-    {  8, 18, 12.60, -37, 22, 27.1, 6.70 },
-    { 21, 53, 55.70, -37, 21, 54.0, 3.01 },
-    { 18, 56, 40.51, -37, 20, 35.9, 5.38 },
-    {  7, 30, 42.41, -37, 20, 22.9, 6.65 },
-    {  5, 23, 39.00, -37, 20, 12.1, 6.82 },
-    { 10,  8,  1.70, -37, 20,  1.0, 6.36 },
-    {  3, 42, 50.11, -37, 18, 49.0, 4.59 },
-    { 17, 30, 45.79, -37, 17, 44.9, 2.69 },
-    {  8, 11,  1.61, -37, 17, 31.9, 6.44 },
-    {  7, 24, 47.30, -37, 17, 26.9, 6.84 },
-    {  7, 24, 47.21, -37, 17, 24.0, 6.97 },
-    {  8,  1, 37.39, -37, 17,  1.0, 5.95 },
-    { 21, 56, 22.80, -37, 15, 13.0, 5.46 },
-    {  6, 17,  9.50, -37, 15, 11.2, 5.87 },
-    {  6,  7, 31.61, -37, 15, 11.2, 5.02 },
-    { 11, 36, 40.80, -37, 14, 16.1, 6.31 },
-    {  5, 28, 15.31, -37, 13, 50.2, 5.57 },
-    { 17,  6, 20.30, -37, 13, 39.0, 5.98 },
-    { 17, 22, 54.91, -37, 13, 14.2, 5.93 },
-    { 16, 39,  5.21, -37, 13,  3.0, 5.91 },
-    { 11, 43, 27.19, -37, 11, 25.1, 5.98 },
-    {  9, 49, 28.10, -37, 11, 11.0, 5.97 },
-    { 16, 28, 14.69, -37, 10, 45.8, 5.79 },
-    {  1, 47, 47.81, -37,  9, 34.9, 6.32 },
-    {  8, 44, 51.89, -37,  8, 49.9, 5.76 },
-    {  4, 42,  3.50, -37,  8, 39.8, 5.05 },
-    { 10, 56, 43.10, -37,  8, 16.1, 4.60 },
-    {  5, 55, 29.90, -37,  7, 14.9, 4.97 },
-    { 18, 58, 43.39, -37,  6, 27.0, 4.87 },
-    { 17, 33, 36.50, -37,  6, 14.0, 1.63 },
-    {  7, 17,  8.59, -37,  5, 51.0, 2.70 },
-    { 15, 19, 31.61, -37,  5, 48.1, 6.20 },
-    { 19,  6, 25.10, -37,  3, 47.9, 4.93 },
-    { 19,  6, 25.10, -37,  3, 47.9, 4.99 },
-    { 19,  1,  4.30, -37,  3, 42.8, 6.40 },
-    { 19,  1,  3.19, -37,  3, 38.9, 6.69 },
-    {  8,  2,  6.19, -37,  3,  2.2, 6.34 },
-    { 17, 49, 51.50, -37,  2, 35.9, 3.21 },
-    { 14, 19, 23.90, -37,  0, 13.0, 5.94 },
-    {  6, 37, 13.80, -36, 59, 26.2, 5.71 },
-    { 17, 42, 51.00, -36, 56, 44.9, 5.54 },
-    {  6, 31, 34.99, -36, 56, 24.0, 6.34 },
-    {  1, 32, 55.99, -36, 51, 55.1, 5.51 },
-    { 15, 23,  9.41, -36, 51, 31.0, 4.54 },
-    { 17, 58, 55.61, -36, 51, 29.9, 5.74 },
-    {  1, 42,  3.00, -36, 49, 57.0, 5.72 },
-    { 10, 18, 37.80, -36, 48, 16.9, 6.30 },
-    { 16,  6, 35.50, -36, 48,  7.9, 4.23 },
-    {  6, 35, 24.10, -36, 46, 48.0, 5.59 },
-    { 17, 28, 56.11, -36, 46, 41.9, 6.02 },
-    { 15, 27, 18.19, -36, 46,  4.1, 5.45 },
-    { 18, 17, 37.61, -36, 45, 42.1, 3.11 },
-    { 16,  7, 16.39, -36, 45, 20.2, 5.73 },
-    {  7, 18, 38.21, -36, 44, 34.1, 5.11 },
-    {  7, 18, 18.41, -36, 44,  3.1, 4.66 },
-    {  8, 30, 29.59, -36, 43, 16.0, 6.69 },
-    { 18, 44,  7.70, -36, 43,  7.0, 6.32 },
-    { 13, 20, 35.81, -36, 42, 43.9, 2.75 },
-    {  6, 24,  1.01, -36, 42, 28.1, 5.62 },
-    { 18,  9, 22.39, -36, 40, 21.0, 6.58 },
-    { 18, 22, 53.11, -36, 40,  9.8, 5.34 },
-    {  8, 18, 33.29, -36, 39, 33.8, 4.45 },
-    { 14, 48, 38.11, -36, 38,  4.9, 6.04 },
-    {  8, 39, 22.10, -36, 36, 24.8, 6.13 },
-    {  7, 16, 49.51, -36, 35, 34.1, 5.03 },
-    {  8, 52, 38.59, -36, 32, 44.2, 6.42 },
-    {  7, 12, 25.70, -36, 32, 39.8, 5.96 },
-    { 11, 17, 43.01, -36, 32,  3.8, 6.68 },
-    {  1, 38, 27.41, -36, 31, 41.9, 5.94 },
-    { 10, 15, 20.90, -36, 31,  5.2, 6.19 },
-    {  7, 38, 43.90, -36, 29, 48.8, 5.80 },
-    {  8, 21, 21.00, -36, 29,  3.8, 5.20 },
-    { 17, 55,  7.90, -36, 28, 32.9, 6.06 },
-    { 20, 16, 23.71, -36, 27, 15.8, 6.39 },
-    { 13, 51, 36.60, -36, 25, 59.9, 6.35 },
-    {  2, 32, 14.81, -36, 25, 39.0, 6.30 },
-    {  3, 50, 37.61, -36, 25, 31.1, 6.86 },
-    { 21, 13, 18.89, -36, 25, 26.0, 5.96 },
-    { 23,  2, 34.01, -36, 25, 14.9, 6.47 },
-    { 22, 55, 14.90, -36, 23, 19.0, 6.40 },
-    { 10,  5, 15.19, -36, 23,  2.0, 6.27 },
-    { 18,  1, 48.31, -36, 22, 40.1, 6.30 },
-    { 13, 15,  9.70, -36, 22, 16.0, 6.19 },
-    { 14,  6, 40.99, -36, 22, 12.0, 2.06 },
-    {  7, 53,  3.50, -36, 21, 50.0, 5.43 },
-    { 12, 43, 58.70, -36, 20, 57.1, 6.39 },
-    {  8, 13, 58.80, -36, 20, 28.0, 6.11 },
-    {  7, 33, 51.00, -36, 20, 17.9, 5.54 },
-    {  8, 13, 58.39, -36, 19, 21.0, 5.08 },
-    {  9, 49, 51.29, -36, 16,  7.0, 6.37 },
-    { 15,  6, 13.90, -36, 15, 51.1, 6.27 },
-    { 15, 21, 48.41, -36, 15, 41.0, 3.56 },
-    { 13, 46, 56.40, -36, 15,  6.8, 5.15 },
-    { 18, 23, 28.90, -36, 14, 17.9, 5.55 },
-    {  6, 33, 49.51, -36, 13, 55.9, 5.42 },
-    {  6, 51, 42.29, -36, 13, 49.1, 5.96 },
-    { 21, 15, 46.80, -36, 12, 38.9, 6.12 },
-    {  3, 49, 27.31, -36, 12,  1.1, 4.17 },
-    { 15, 57, 21.29, -36, 11,  6.0, 5.80 },
-    { 19,  9, 36.41, -36,  9, 52.9, 6.56 },
-    { 11, 23, 12.70, -36,  9, 52.9, 5.00 },
-    {  7, 31, 25.80, -36,  9, 10.1, 6.68 },
-    { 14, 41,  1.39, -36,  8,  6.0, 5.67 },
-    { 20, 59, 59.69, -36,  7, 46.9, 6.11 },
-    { 20, 46, 18.60, -36,  7, 13.1, 6.49 },
-    {  3, 47, 49.61, -36,  6, 20.9, 6.21 },
-    { 20, 11, 11.90, -36,  6,  4.0, 5.32 },
-    {  9, 37, 28.30, -36,  5, 44.9, 5.98 },
-    { 12, 17, 47.30, -36,  5, 38.0, 6.15 },
-    { 15, 13,  7.39, -36,  5, 29.0, 6.10 },
-    {  6, 35, 54.00, -36,  5, 20.0, 6.35 },
-    { 11, 25, 29.40, -36,  3, 47.2, 5.22 },
-    {  7, 44,  9.60, -36,  3, 46.1, 5.80 },
-    {  7, 43, 12.00, -36,  3,  1.1, 5.60 },
-    { 18,  6, 23.71, -36,  1, 10.9, 5.95 },
-    { 18, 25, 21.70, -35, 59, 30.1, 6.15 },
-    {  5, 14, 28.80, -35, 58, 37.9, 5.76 },
-    {  7, 32, 22.30, -35, 57, 41.0, 6.30 },
-    {  9, 29, 14.69, -35, 57,  5.0, 4.51 },
-    {  3, 13,  1.49, -35, 56, 38.0, 6.27 },
-    {  8, 42, 57.00, -35, 56, 35.9, 6.42 },
-    { 17,  0, 36.89, -35, 56,  3.1, 5.97 },
-    {  3, 25, 55.80, -35, 55, 14.9, 6.39 },
-    { 17, 22, 37.99, -35, 54, 36.0, 6.47 },
-    { 11, 47,  7.01, -35, 54, 24.8, 6.17 },
-    {  8, 15, 58.90, -35, 54, 10.1, 6.16 },
-    { 18,  4, 50.40, -35, 54,  5.0, 6.00 },
-    {  8, 13, 29.59, -35, 53, 58.9, 4.78 },
-    {  9, 58, 52.30, -35, 53, 28.0, 5.23 },
-    {  7, 31, 42.79, -35, 53, 16.1, 6.61 },
-    {  7, 54, 10.99, -35, 52, 39.0, 5.49 },
-    { 13,  6, 54.31, -35, 51, 42.8, 6.54 },
-    { 10,  9, 31.80, -35, 51, 24.1, 6.13 },
-    {  3, 28, 11.50, -35, 51, 11.9, 6.50 },
-    {  2, 50, 14.81, -35, 50, 37.0, 5.92 },
-    {  7, 23, 58.30, -35, 50, 16.1, 6.31 },
-    {  5, 13, 46.49, -35, 49, 32.2, 6.98 },
-    {  9, 35, 11.81, -35, 49, 26.0, 6.49 },
-    { 11,  4, 54.19, -35, 48, 16.9, 5.43 },
-    {  5, 50, 57.60, -35, 46,  5.9, 3.12 },
-    { 17, 16, 21.50, -35, 44, 57.8, 6.12 },
-    { 10, 40, 51.60, -35, 44, 30.1, 6.37 },
-    {  5,  8, 14.81, -35, 43,  5.9, 6.52 },
-    {  9, 31, 32.90, -35, 42, 54.0, 5.87 },
-    {  5,  4, 26.09, -35, 42, 19.1, 6.34 },
-    { 13, 48, 55.10, -35, 42, 14.0, 6.53 },
-    { 12,  5, 56.71, -35, 41, 38.0, 6.23 },
-    {  3, 27, 33.41, -35, 40, 53.0, 5.71 },
-    {  2, 50, 40.39, -35, 40, 34.0, 5.47 },
-    {  5, 47, 18.60, -35, 40, 28.9, 6.32 },
-    { 20, 20, 51.89, -35, 40, 25.0, 6.46 },
-    { 13, 53, 32.81, -35, 39, 51.1, 5.54 },
-    {  1,  6, 26.50, -35, 39, 38.9, 6.61 },
-    {  4, 30, 40.30, -35, 39, 13.0, 5.96 },
-    { 18, 44, 19.39, -35, 38, 30.8, 4.87 },
-    { 17, 52, 57.89, -35, 37, 27.1, 6.03 },
-    { 20, 28, 46.70, -35, 35, 44.9, 6.10 },
-    {  2, 47, 33.70, -35, 33,  2.9, 6.51 },
-    {  4, 23,  7.70, -35, 32, 42.0, 6.39 },
-    { 23, 28,   .70, -35, 32, 39.8, 6.32 },
-    { 22, 58, 34.99, -35, 31, 23.2, 6.13 },
-    {  6,  5, 27.10, -35, 30, 49.0, 5.80 },
-    {  6, 57, 17.59, -35, 30, 27.0, 6.23 },
-    {  9, 42, 41.40, -35, 30,  6.1, 6.41 },
-    {  8, 14, 13.20, -35, 29, 26.2, 5.78 },
-    {  5,  4, 24.41, -35, 28, 59.9, 4.55 },
-    {  5, 31, 12.70, -35, 28, 14.2, 3.87 },
-    {  8,  9, 10.20, -35, 27, 18.0, 6.20 },
-    {  8, 18, 17.40, -35, 27,  6.1, 5.58 },
-    { 17,  6, 28.39, -35, 27,  4.0, 6.13 },
-    { 19, 19, 40.01, -35, 25, 17.0, 5.59 },
-    { 12, 23, 35.40, -35, 24, 46.1, 5.32 },
-    {  6, 56, 45.70, -35, 20, 30.1, 6.29 },
-    { 11, 27, 58.49, -35, 19, 43.0, 6.45 },
-    { 13, 53, 52.20, -35, 18, 51.8, 6.19 },
-    {  8, 40,  6.19, -35, 18, 29.9, 3.97 },
-    {  5, 57, 32.21, -35, 16, 59.9, 4.36 },
-    {  7, 37, 44.81, -35, 16, 37.9, 6.60 },
-    { 19, 59, 44.21, -35, 16, 35.0, 4.37 },
-    {  4, 10, 45.79, -35, 16, 26.0, 6.44 },
-    {  6, 31, 13.01, -35, 15, 33.1, 5.84 },
-    { 16, 36, 22.51, -35, 15, 20.2, 4.16 },
-    {  7, 49, 14.69, -35, 14, 35.9, 5.93 },
-    { 20, 16, 26.50, -35, 11, 52.1, 6.53 },
-    { 14, 44, 59.21, -35, 11, 30.8, 4.92 },
-    { 12, 25, 21.79, -35, 11, 11.0, 5.73 },
-    { 14, 43, 39.41, -35, 10, 25.0, 4.05 },
-    {  6, 16, 33.10, -35,  8, 26.2, 4.37 },
-    {  5, 33,  7.39, -35,  8, 22.9, 5.78 },
-    {  0, 11, 43.99, -35,  7, 59.2, 5.25 },
-    {  8, 27, 59.30, -35,  6, 50.0, 5.75 },
-    { 11, 53, 26.81, -35,  4,   .1, 6.17 },
-    {  6, 25, 29.90, -35,  3, 50.0, 6.25 },
-    { 17, 52, 55.90, -35,  1,  7.0, 6.45 },
-    {  9, 27, 38.40, -35,  0, 28.1, 6.65 },
-    { 17, 18, 57.19, -34, 59, 22.9, 5.91 },
-    { 19, 21, 29.90, -34, 59,  2.0, 6.48 },
-    {  7, 37, 22.10, -34, 58,  7.0, 4.53 },
-    {  5, 15, 46.99, -34, 55, 36.1, 6.66 },
-    {  4, 51, 28.20, -34, 54, 23.0, 5.86 },
-    {  0, 14, 58.20, -34, 54, 15.8, 6.17 },
-    { 17, 53, 23.30, -34, 53, 43.1, 5.60 },
-    {  5, 17, 29.09, -34, 53, 43.1, 4.83 },
-    {  7, 54, 39.91, -34, 50, 48.8, 6.15 },
-    { 17, 53, 58.10, -34, 49, 54.1, 6.42 },
-    { 17, 52, 13.61, -34, 47, 57.1, 5.90 },
-    { 14, 22, 19.70, -34, 47, 12.8, 5.56 },
-    { 17, 53, 45.50, -34, 47,  8.9, 6.38 },
-    {  7,  5, 31.99, -34, 46, 40.1, 6.14 },
-    {  4, 24, 56.40, -34, 45, 28.1, 6.55 },
-    { 17, 53, 54.91, -34, 45,  9.0, 5.96 },
-    { 23,  3, 29.81, -34, 44, 57.8, 5.11 },
-    { 18, 49, 17.21, -34, 44, 55.0, 6.62 },
-    { 11, 40, 12.79, -34, 44, 40.9, 4.70 },
-    { 11, 17, 39.19, -34, 44, 13.9, 6.45 },
-    {  3, 53, 38.90, -34, 43, 55.9, 5.11 },
-    { 17, 53, 19.61, -34, 43, 50.2, 6.17 },
-    { 15, 42, 40.99, -34, 42, 38.2, 4.75 },
-    {  7, 52, 15.70, -34, 42, 19.1, 5.01 },
-    { 12, 10,  2.50, -34, 42, 18.0, 6.17 },
-    { 16, 31, 22.90, -34, 42, 15.8, 4.23 },
-    {  5, 20, 20.59, -34, 41, 56.0, 6.34 },
-    { 19, 59, 51.29, -34, 41, 52.1, 5.30 },
-    { 17, 25,  2.71, -34, 41, 47.0, 6.16 },
-    { 15, 46, 44.21, -34, 40, 57.0, 5.61 },
-    {  5, 42, 15.10, -34, 40,  4.1, 5.29 },
-    {  2, 33,  7.01, -34, 39,   .0, 5.90 },
-    {  8, 32, 58.61, -34, 38,  2.0, 6.36 },
-    {  8, 46, 49.20, -34, 37, 22.1, 6.37 },
-    {  8, 19, 29.40, -34, 35, 25.1, 6.43 },
-    {  2, 36, 58.61, -34, 34, 41.9, 5.79 },
-    { 13, 36, 50.50, -34, 28,  4.1, 6.50 },
-    { 17, 54, 27.19, -34, 27, 59.0, 5.96 },
-    { 13, 49, 26.71, -34, 27,  2.9, 4.19 },
-    { 17, 52, 19.70, -34, 25,   .1, 5.84 },
-    { 15, 39, 46.01, -34, 24, 42.8, 4.67 },
-    {  6, 19, 40.99, -34, 23, 48.1, 5.78 },
-    { 18, 24, 10.30, -34, 23,  4.9, 1.85 },
-    {  6, 50, 52.39, -34, 22,  1.9, 4.99 },
-    { 15,  1, 58.10, -34, 21, 32.0, 6.22 },
-    {  5, 21, 16.90, -34, 20, 43.1, 6.09 },
-    {  6,  7,  3.70, -34, 18, 42.8, 5.83 },
-    { 16, 50,  9.79, -34, 17, 35.9, 2.29 },
-    { 17, 32, 24.50, -34, 16, 46.9, 6.17 },
-    {  7, 45, 34.99, -34, 10, 23.2, 5.37 },
-    { 22, 47, 19.10, -34,  9, 40.0, 6.28 },
-    {  6, 20, 36.31, -34,  8, 38.0, 5.53 },
-    {  7, 26, 42.29, -34,  8, 26.9, 5.90 },
-    { 12, 13, 13.01, -34,  7, 32.2, 6.50 },
-    { 17,  4, 49.39, -34,  7, 22.1, 4.87 },
-    { 17, 52, 49.20, -34,  6, 51.1, 6.06 },
-    {  6, 58, 25.10, -34,  6, 42.1, 5.06 },
-    { 18, 17, 36.10, -34,  6, 25.9, 6.16 },
-    {  9, 19, 47.90, -34,  6, 11.9, 6.39 },
-    {  5, 39, 38.90, -34,  4, 27.1, 2.64 },
-    { 10, 49, 57.00, -34,  3, 29.2, 5.61 },
-    { 22,  8, 25.99, -34,  2, 38.0, 4.99 },
-    {  4, 24,  2.21, -34,  1,   .8, 3.96 },
-    { 22,  9, 55.70, -34,  0, 52.9, 5.37 },
-    {  4, 45, 49.61, -34,  0, 18.0, 6.86 },
-    { 12, 50, 41.21, -33, 59, 57.8, 4.91 },
-    { 15, 56, 53.50, -33, 57, 59.0, 5.12 },
-    { 15, 56, 54.19, -33, 57, 51.1, 5.62 },
-    {  0, 39, 57.91, -33, 57, 42.1, 6.69 },
-    { 18, 25, 54.60, -33, 56, 43.1, 6.30 },
-    { 21, 32, 14.59, -33, 56, 40.9, 5.97 },
-    {  6,  1, 16.39, -33, 54, 42.1, 5.55 },
-    { 11, 52, 54.60, -33, 54, 29.2, 4.28 },
-    {  4, 19,  3.00, -33, 54, 18.0, 6.37 },
-    { 14, 55, 44.69, -33, 51, 20.9, 5.32 },
-    {  2, 28,  1.70, -33, 48, 40.0, 5.14 },
-    {  5, 53,  6.89, -33, 48,  5.0, 4.87 },
-    { 18, 10, 55.20, -33, 47, 58.9, 6.16 },
-    {  4, 17, 53.69, -33, 47, 53.9, 3.56 },
-    { 12, 13, 36.70, -33, 47, 34.1, 6.33 },
-    { 20, 49, 58.10, -33, 46, 46.9, 4.90 },
-    {  1, 28, 43.30, -33, 45, 49.0, 6.58 },
-    {  8, 37, 29.69, -33, 44, 44.9, 6.48 },
-    { 10, 59, 13.90, -33, 44, 13.9, 5.71 },
-    {  7, 19, 13.70, -33, 43, 37.9, 6.30 },
-    { 23, 19, 43.20, -33, 42, 29.2, 6.37 },
-    { 20,  0, 20.30, -33, 42, 14.0, 5.66 },
-    { 17, 31, 47.40, -33, 42, 10.1, 6.44 },
-    { 21, 39,  6.10, -33, 40, 45.1, 6.28 },
-    { 15, 50, 57.50, -33, 37, 37.9, 3.95 },
-    { 13, 41, 45.70, -33, 35, 48.8, 6.05 },
-    { 11, 36, 34.99, -33, 34, 12.0, 5.74 },
-    {  8, 13, 41.09, -33, 34,  9.1, 6.37 },
-    {  8,  5, 44.90, -33, 34,  9.1, 6.14 },
-    { 17, 15, 19.30, -33, 32, 53.9, 5.53 },
-    { 16,  9, 52.61, -33, 32, 44.9, 5.54 },
-    {  0,  8,  3.50, -33, 31, 45.8, 5.68 },
-    { 19, 16, 32.81, -33, 31, 18.1, 6.25 },
-    { 16, 55, 57.79, -33, 30, 25.9, 6.37 },
-    { 13,  0, 32.59, -33, 30, 19.1, 6.02 },
-    {  7,  0, 49.80, -33, 27, 55.1, 6.40 },
-    {  7, 34, 12.79, -33, 27, 47.9, 6.11 },
-    {  6, 22,  6.79, -33, 26, 11.0, 3.85 },
-    { 20, 40, 19.80, -33, 25, 54.8, 5.47 },
-    {  9, 56, 35.50, -33, 25,  7.0, 5.84 },
-    {  5, 41, 27.00, -33, 24,  2.2, 6.34 },
-    { 12, 46, 46.01, -33, 18, 56.2, 5.86 },
-    { 11, 57,  3.70, -33, 18, 55.1, 6.21 },
-    { 13, 34, 43.61, -33, 18, 38.9, 6.44 },
-    { 14, 54, 37.99, -33, 18,  2.2, 5.82 },
-    {  7, 49, 35.40, -33, 17, 20.0, 5.60 },
-    { 16, 57, 11.09, -33, 15, 33.8, 5.48 },
-    { 14, 16, 18.29, -33, 14, 29.0, 6.55 },
-    { 14, 18, 23.81, -33, 13, 14.2, 6.54 },
-    { 16,  4, 17.81, -33, 12, 51.8, 6.10 },
-    { 16, 23, 56.71, -33, 11, 57.8, 6.47 },
-    { 13, 23,  8.71, -33, 11, 24.0, 6.22 },
-    {  8, 43, 35.50, -33, 11, 11.0, 3.68 },
-    { 20, 51, 58.80, -33, 10, 37.9, 6.04 },
-    { 16, 41, 45.50, -33,  8, 47.0, 5.87 },
-    { 22,  8, 42.70, -33,  7, 32.2, 6.37 },
-    { 15, 36, 11.40, -33,  5, 34.1, 6.24 },
-    { 22, 38, 51.50, -33,  4, 53.0, 5.66 },
-    {  5, 35, 15.41, -33,  4, 48.0, 5.78 },
-    {  1, 58, 26.69, -33,  4,   .1, 6.35 },
-    {  8, 21, 22.99, -33,  3, 15.8, 4.83 },
-    { 17, 43,  6.89, -33,  3,  4.0, 6.40 },
-    { 21, 36, 48.89, -33,  2, 53.2, 6.11 },
-    { 19, 55,  5.09, -33,  2, 47.0, 6.46 },
-    { 13, 45, 41.21, -33,  2, 38.0, 4.23 },
-    { 10, 13, 24.79, -33,  1, 54.8, 6.38 },
-    { 21, 44, 56.81, -33,  1, 32.9, 4.34 },
-    { 18, 33, 57.79, -33,  1,   .1, 5.28 },
-    { 16, 14, 22.30, -33,  0, 41.0, 5.92 },
-    {  0, 27, 55.70, -33,  0, 25.9, 4.81 },
-    { 20,  5, 32.11, -33,  0,   .0, 6.53 },
-    { 13, 51, 50.11, -32, 59, 40.9, 6.06 },
-    { 13, 51, 49.61, -32, 59, 39.8, 4.56 },
-    { 18, 31,  4.80, -32, 59, 21.1, 5.34 },
-    { 22,  8, 22.99, -32, 59, 19.0, 4.50 },
-    { 11, 37,  1.20, -32, 59, 17.2, 6.29 },
-    { 15, 31, 50.30, -32, 52, 52.0, 6.46 },
-    { 22, 52, 31.61, -32, 52, 32.2, 4.46 },
-    { 11, 34, 29.50, -32, 49, 53.0, 5.98 },
-    { 12, 26, 51.70, -32, 49, 48.0, 5.55 },
-    { 22, 49, 59.09, -32, 48, 19.1, 6.33 },
-    {  8, 49, 51.50, -32, 46, 50.2, 5.21 },
-    { 18,  9, 59.90, -32, 43, 10.9, 6.43 },
-    {  6, 34, 35.30, -32, 42, 59.0, 5.62 },
-    { 10, 42, 43.20, -32, 42, 56.9, 5.64 },
-    {  3, 23, 44.59, -32, 42, 25.9, 6.50 },
-    {  8,  4, 16.20, -32, 40, 30.0, 5.31 },
-    { 17, 17,  3.70, -32, 39, 46.1, 5.55 },
-    { 16,  9, 31.70, -32, 38, 58.9, 6.19 },
-    { 15,  2, 59.30, -32, 38, 35.9, 5.44 },
-    { 14, 56, 30.91, -32, 38, 12.1, 6.06 },
-    {  5, 39, 49.80, -32, 37, 45.1, 5.45 },
-    {  8, 34, 31.70, -32, 35, 55.0, 6.43 },
-    { 11,  7,  8.40, -32, 35, 13.9, 6.59 },
-    { 17, 34, 42.50, -32, 34, 54.1, 5.70 },
-    {  6, 28, 10.10, -32, 34, 48.0, 4.48 },
-    { 17, 18, 20.40, -32, 33, 11.9, 6.36 },
-    { 22, 10,  8.81, -32, 32, 53.9, 4.92 },
-    {  1, 26, 58.10, -32, 32, 35.2, 5.79 },
-    { 22, 55, 56.90, -32, 32, 22.9, 4.21 },
-    { 12, 32,  4.51, -32, 32,  1.0, 6.46 },
-    { 23, 18, 49.39, -32, 31, 54.8, 4.41 },
-    {  2, 44, 20.50, -32, 31, 30.0, 6.22 },
-    {  8, 52, 26.09, -32, 30, 33.1, 6.50 },
-    {  6, 49, 50.50, -32, 30, 31.0, 3.96 },
-    {  2, 59, 38.30, -32, 30, 25.9, 6.31 },
-    { 11, 41, 43.99, -32, 29, 58.9, 5.22 },
-    {  8,  3,  4.10, -32, 27, 50.0, 5.82 },
-    { 17, 12, 58.70, -32, 26, 19.0, 6.01 },
-    { 11, 12, 14.81, -32, 26,  2.0, 6.38 },
-    {  2, 49,  5.40, -32, 24, 20.9, 4.46 },
-    {  6, 28, 39.19, -32, 22, 16.0, 5.74 },
-    { 11,  9, 53.40, -32, 22,  3.0, 5.81 },
-    { 22, 31, 30.31, -32, 20, 46.0, 4.29 },
-    { 21,  6, 24.70, -32, 20, 30.1, 5.18 },
-    {  6, 37, 47.59, -32, 20, 22.9, 5.27 },
-    {  1, 42,  8.59, -32, 19, 36.8, 5.25 },
-    {  5, 45, 59.90, -32, 18, 23.0, 5.17 },
-    { 21,  1, 17.50, -32, 15, 28.1, 4.67 },
-    {  7, 23, 31.90, -32, 12,  7.9, 5.39 },
-    {  9, 37,  9.89, -32, 10, 43.0, 5.63 },
-    { 21, 17, 56.30, -32, 10, 21.0, 4.71 },
-    {  6,  4, 20.30, -32, 10, 21.0, 5.65 },
-    {  8, 30, 28.61, -32,  9, 33.8, 5.65 },
-    { 17,  1, 52.70, -32,  8, 37.0, 5.03 },
-    {  8, 14, 10.99, -32,  8, 26.9, 6.06 },
-    {  0, 29, 48.91, -32,  7,   .1, 6.57 },
-    { 16, 43, 38.71, -32,  6, 22.0, 6.46 },
-    { 19, 30, 14.69, -32,  5, 31.9, 6.60 },
-    { 23, 40, 38.21, -32,  4, 23.2, 5.31 },
-    { 20,  4, 19.61, -32,  3, 23.0, 4.99 },
-    { 20, 50, 47.11, -32,  3, 15.8, 6.36 },
-    {  6, 32, 39.00, -32,  1, 50.2, 5.69 },
-    { 16,  3, 34.30, -32,  0,  2.2, 6.01 },
-    {  5, 56, 49.01, -31, 58, 34.0, 6.44 },
-    { 11,  3, 16.10, -31, 57, 38.9, 6.46 },
-    {  3, 42, 14.90, -31, 56, 17.9, 5.00 },
-    { 13, 53, 12.50, -31, 55, 40.1, 4.73 },
-    {  7, 23,   .60, -31, 55, 26.0, 5.43 },
-    { 23, 55, 16.61, -31, 55, 18.1, 6.10 },
-    { 19, 46,  1.20, -31, 54, 31.0, 5.52 },
-    {  1, 34, 50.71, -31, 53, 31.9, 6.12 },
-    {  9, 30, 45.41, -31, 53, 29.0, 7.00 },
-    { 16,  1, 19.51, -31, 53, 21.8, 6.33 },
-    {  9, 30, 46.10, -31, 53, 21.8, 6.18 },
-    { 23, 55, 16.61, -31, 53,  3.1, 6.83 },
-    {  3, 34, 33.50, -31, 52, 28.9, 6.40 },
-    {  9, 31, 32.21, -31, 52, 18.8, 5.93 },
-    { 23, 37,  5.40, -31, 52, 14.9, 6.52 },
-    { 11, 33,   .10, -31, 51, 28.1, 3.54 },
-    {  7, 28, 51.31, -31, 50, 53.9, 6.38 },
-    {  7, 28, 51.50, -31, 50, 48.8, 7.13 },
-    { 11,  0, 40.80, -31, 50, 21.8, 6.07 },
-    { 19, 20, 26.21, -31, 49,  4.1, 6.58 },
-    {  7, 24, 43.80, -31, 48, 32.0, 5.35 },
-    {  6, 45, 22.80, -31, 47, 37.0, 5.92 },
-    {  6, 23, 14.40, -31, 47, 24.0, 6.34 },
-    {  6, 55, 54.79, -31, 47, 24.0, 6.36 },
-    { 15, 56, 13.90, -31, 47,  8.9, 6.29 },
-    {  5,  2, 22.80, -31, 46, 17.0, 5.94 },
-    {  9, 20, 44.21, -31, 45, 38.2, 6.82 },
-    {  7, 25, 43.01, -31, 44, 19.0, 6.31 },
-    {  6, 50, 23.30, -31, 42, 22.0, 5.70 },
-    { 17, 49, 10.51, -31, 42, 11.9, 4.83 },
-    { 10, 48, 14.21, -31, 41, 17.9, 5.88 },
-    { 14,  3,  1.70, -31, 41,  2.0, 6.18 },
-    {  8, 27, 16.39, -31, 40, 23.2, 6.33 },
-    { 22, 36, 35.40, -31, 39, 50.0, 5.82 },
-    {  7, 40, 52.70, -31, 39, 38.9, 6.56 },
-    { 22, 55, 51.41, -31, 37, 59.2, 6.10 },
-    { 13, 52,   .91, -31, 37,  9.8, 6.12 },
-    { 20, 41, 23.71, -31, 35, 53.9, 5.76 },
-    { 22, 56, 24.00, -31, 33, 56.2, 6.48 },
-    {  1,  2, 26.40, -31, 33,  6.8, 5.50 },
-    { 15, 14, 37.30, -31, 31,  9.1, 4.91 },
-    { 13, 16, 53.11, -31, 30, 22.0, 5.10 },
-    {  8, 32, 51.50, -31, 30,  2.9, 6.38 },
-    {  7, 29,  4.90, -31, 27, 23.0, 5.77 },
-    {  0, 16,  8.90, -31, 26, 47.0, 5.67 },
-    {  5, 56, 20.90, -31, 22, 57.0, 5.50 },
-    { 13, 55, 44.50, -31, 17,  6.0, 6.51 },
-    { 21, 29,  3.79, -31, 14, 19.0, 6.50 },
-    { 15, 40, 15.41, -31, 12, 49.0, 6.34 },
-    { 15, 18, 41.30, -31, 12, 33.8, 6.18 },
-    {  2, 28, 35.40, -31,  6,  9.0, 6.11 },
-    { 11, 32, 54.10, -31,  5, 13.9, 5.04 },
-    {  7, 13, 47.11, -31,  5,  2.0, 6.60 },
-    { 15, 55, 30.41, -31,  5,  1.0, 6.21 },
-    {  3, 33, 56.81, -31,  4, 49.1, 6.20 },
-    {  1, 49, 19.49, -31,  4, 22.1, 6.34 },
-    {  6, 44, 28.39, -31,  4, 14.2, 5.20 },
-    { 10, 27,  9.10, -31,  4,  4.1, 4.25 },
-    { 19,  4, 25.10, -31,  2, 48.8, 5.50 },
-    { 18, 58, 21.29, -31,  2, 10.0, 6.12 },
-    {  0, 23, 12.60, -31,  2, 10.0, 6.55 },
-    {  6, 58, 43.80, -30, 59, 52.1, 6.42 },
-    {  7, 30, 42.50, -30, 57, 43.9, 4.65 },
-    {  6, 45, 31.30, -30, 56, 56.0, 5.80 },
-    {  1, 23, 31.01, -30, 56, 44.2, 5.84 },
-    { 14, 41, 51.10, -30, 55, 59.9, 6.37 },
-    {  8, 15, 52.51, -30, 55, 32.9, 6.21 },
-    { 15,  6, 33.29, -30, 55,  8.0, 5.96 },
-    {  7, 55, 13.70, -30, 55,  3.0, 6.44 },
-    { 16, 19, 32.69, -30, 54, 24.1, 5.49 },
-    { 21, 47, 44.21, -30, 53, 53.9, 5.01 },
-    {  7, 16, 57.19, -30, 53, 48.1, 6.32 },
-    { 11, 51, 41.59, -30, 50,  6.0, 5.85 },
-    {  3, 16, 11.30, -30, 49, 39.0, 6.65 },
-    {  7, 12,  4.10, -30, 49, 18.1, 6.10 },
-    {  2, 51, 55.30, -30, 48, 51.8, 6.40 },
-    {  1, 12, 23.40, -30, 48,  7.9, 6.52 },
-    {  4, 43,  9.29, -30, 45, 56.2, 5.68 },
-    { 18, 25,  1.51, -30, 45, 24.1, 5.60 },
-    { 18, 52, 41.69, -30, 44,  3.1, 6.63 },
-    { 18, 10,  5.69, -30, 43, 43.0, 5.53 },
-    {  2, 12, 54.50, -30, 43, 26.0, 5.28 },
-    { 20, 53, 25.01, -30, 43,  7.0, 6.35 },
-    {  4, 36, 50.90, -30, 43,   .1, 6.30 },
-    { 14, 33,  9.60, -30, 42, 51.1, 6.09 },
-    {  7, 15, 21.00, -30, 41, 11.0, 5.36 },
-    { 22, 40, 22.30, -30, 39, 32.0, 5.87 },
-    {  7,  6,   .60, -30, 39, 20.2, 6.34 },
-    {  2, 40,  2.50, -30, 38,  2.0, 6.52 },
-    { 10, 29, 35.40, -30, 36, 25.9, 5.56 },
-    { 21, 55, 55.61, -30, 36, 23.0, 6.41 },
-    { 16, 54, 36.00, -30, 35, 13.9, 6.35 },
-    {  6, 45,  2.40, -30, 35, 10.0, 6.54 },
-    { 10,  2, 49.30, -30, 34, 39.0, 6.54 },
-    { 14, 52, 33.10, -30, 34, 36.8, 6.29 },
-    {  4, 35, 33.00, -30, 33, 43.9, 3.82 },
-    { 17, 51, 12.50, -30, 33, 25.9, 6.66 },
-    { 19, 58, 56.40, -30, 32, 17.2, 6.28 },
-    {  5, 42, 11.59, -30, 32,  8.2, 6.19 },
-    {  4,  0, 40.70, -30, 29, 26.9, 5.93 },
-    { 20, 34, 47.40, -30, 28, 25.0, 6.40 },
-    {  6, 39, 42.70, -30, 28, 13.1, 5.71 },
-    { 18,  5, 48.50, -30, 25, 27.1, 2.99 },
-    { 12, 39,  3.50, -30, 25, 19.9, 5.89 },
-    { 17,  8, 47.50, -30, 24, 13.0, 5.97 },
-    {  9,  9, 56.40, -30, 21, 55.1, 5.59 },
-    {  7, 13, 57.19, -30, 20, 24.0, 6.33 },
-    {  7, 57, 40.10, -30, 20,  4.9, 4.79 },
-    {  8,  9,  6.70, -30, 19, 21.0, 6.65 },
-    { 11, 47, 15.70, -30, 17, 12.8, 6.48 },
-    {  7, 56, 22.80, -30, 17,  7.1, 6.33 },
-    {  1, 31, 43.30, -30, 16, 59.9, 5.82 },
-    { 17, 59,  5.50, -30, 15, 11.9, 7.04 },
-    { 17, 59,  5.21, -30, 15, 11.2, 5.16 },
-    {  7, 23, 54.29, -30, 13,   .8, 6.60 },
-    { 17, 15, 51.50, -30, 12, 38.2, 6.21 },
-    {  9, 45, 21.79, -30, 12, 10.1, 6.45 },
-    {  2, 38, 18.70, -30, 11, 39.1, 5.83 },
-    { 11,  7, 54.41, -30, 10, 28.9, 6.54 },
-    {  3, 47, 55.99, -30, 10,  4.1, 5.54 },
-    { 10, 23, 13.10, -30,  9, 43.9, 6.27 },
-    { 15, 17, 49.90, -30,  8, 56.0, 4.34 },
-    { 21,  6,  1.20, -30,  7, 30.0, 5.68 },
-    {  5, 29,  6.70, -30,  7,   .1, 6.75 },
-    {  6, 20, 18.79, -30,  3, 47.9, 3.02 },
-    {  2, 36,  9.29, -30,  2, 40.9, 5.75 },
-    {  4, 47, 49.61, -30,  1, 13.1, 6.37 },
-    { 20, 15, 50.59, -30,  0, 19.1, 6.30 },
-    {  8, 17, 58.30, -30,  0, 11.9, 6.45 },
-    {  2,  1, 14.71, -30,  0,  6.1, 5.35 },
-    { 11,  8, 15.79, -29, 58, 22.1, 6.49 },
-    { 22,  4, 23.90, -29, 55,   .1, 6.47 },
-    {  8, 12, 46.01, -29, 54, 38.9, 6.52 },
-    {  1, 36,  8.40, -29, 54, 27.0, 5.69 },
-    { 22,  3, 17.21, -29, 54, 15.1, 7.10 },
-    {  3, 47, 20.11, -29, 54,  6.8, 6.55 },
-    { 15, 52, 12.79, -29, 53, 12.1, 6.40 },
-    { 19,  2, 36.70, -29, 52, 49.1, 2.60 },
-    { 17, 27, 21.29, -29, 52,   .8, 4.29 },
-    {  2, 57, 13.10, -29, 51, 19.1, 6.29 },
-    {  5, 33, 52.10, -29, 50, 56.0, 6.53 },
-    { 18, 20, 59.69, -29, 49, 41.2, 2.70 },
-    { 18, 27, 49.49, -29, 48, 59.0, 5.92 },
-    {  3, 13, 37.99, -29, 48, 15.1, 6.16 },
-    {  6, 15, 57.19, -29, 47, 17.9, 6.67 },
-    { 15, 38, 39.41, -29, 46, 40.1, 3.66 },
-    {  4, 33, 30.60, -29, 46,   .1, 4.51 },
-    {  6,  6,  5.50, -29, 45, 31.0, 5.81 },
-    { 19, 26, 56.50, -29, 44, 35.9, 5.67 },
-    { 17, 27, 37.49, -29, 43, 27.8, 6.00 },
-    {  0,  2, 19.90, -29, 43, 13.1, 5.01 },
-    { 16, 24, 39.70, -29, 42, 16.9, 5.84 },
-    { 16, 24, 39.60, -29, 42, 11.9, 6.63 },
-    { 18, 35, 59.69, -29, 41, 57.1, 6.37 },
-    { 21, 34, 52.99, -29, 41, 46.0, 6.41 },
-    {  2,  2, 28.10, -29, 39, 54.0, 6.42 },
-    { 10, 29, 28.99, -29, 39, 49.0, 5.58 },
-    { 22, 57, 39.10, -29, 37, 19.9, 1.16 },
-    { 18,  5,  1.30, -29, 34, 48.0, 4.69 },
-    { 13, 32, 34.51, -29, 33, 55.1, 6.45 },
-    {  8, 39, 42.50, -29, 33, 40.0, 4.89 },
-    { 13, 38, 42.00, -29, 33, 38.9, 5.83 },
-    {  0, 33, 41.11, -29, 33, 29.9, 5.55 },
-    { 22, 51, 20.90, -29, 32, 10.0, 5.97 },
-    {  1,  3, 17.59, -29, 31, 32.9, 6.29 },
-    { 23, 10, 46.61, -29, 31, 30.0, 6.51 },
-    { 19, 11, 18.89, -29, 30,  7.9, 6.30 },
-    { 14, 28, 10.39, -29, 29, 30.1, 4.97 },
-    { 23, 59, 27.89, -29, 29,  6.0, 5.62 },
-    {  8, 50,  2.21, -29, 27, 47.2, 5.87 },
-    { 22, 59, 35.81, -29, 27, 43.9, 5.51 },
-    {  5, 51, 59.50, -29, 26, 55.0, 6.45 },
-    { 16, 11,  1.99, -29, 24, 59.0, 5.13 },
-    {  6, 13, 33.29, -29, 23, 46.0, 6.54 },
-    { 18, 52, 37.01, -29, 22, 45.8, 6.13 },
-    { 22, 42, 22.10, -29, 21, 38.9, 6.17 },
-    {  0, 58, 36.41, -29, 21, 27.0, 4.31 },
-    {  3, 46, 27.41, -29, 20, 17.2, 5.90 },
-    { 19, 25,  4.10, -29, 18, 33.1, 5.93 },
-    {  7, 24,  5.71, -29, 18, 11.2, 2.45 },
-    {  2,  4, 29.40, -29, 17, 48.8, 4.69 },
-    { 14, 15,  1.30, -29, 16, 54.8, 6.08 },
-    {  0,  4, 20.30, -29, 16,  7.0, 6.40 },
-    { 11, 32, 16.10, -29, 15, 47.9, 5.81 },
-    { 11, 32, 16.30, -29, 15, 40.0, 5.64 },
-    {  8, 26, 50.81, -29, 12, 55.1, 6.73 },
-    { 15, 56, 53.11, -29, 12, 51.1, 3.88 },
-    { 20, 20, 28.10, -29, 11, 49.9, 6.30 },
-    { 11, 41,  8.40, -29, 11, 47.0, 6.44 },
-    { 14, 57, 13.61, -29,  9, 28.1, 6.29 },
-    {  7, 27, 59.21, -29,  9, 20.9, 5.54 },
-    {  5, 54, 14.09, -29,  8, 52.1, 6.36 },
-    { 16,  2, 39.41, -29,  8,  8.9, 6.03 },
-    { 20, 30, 56.81, -29,  6, 45.0, 6.39 },
-    { 13, 50,  6.50, -29,  4, 53.0, 6.18 },
-    { 10, 18,  7.61, -28, 59, 30.8, 5.34 },
-    {  3, 12,  4.30, -28, 59, 12.8, 3.87 },
-    {  0, 21, 31.20, -28, 58, 54.1, 5.18 },
-    {  6, 58, 37.49, -28, 58, 19.9, 1.50 },
-    {  7, 43, 48.50, -28, 57, 16.9, 3.96 },
-    {  2, 59,  6.60, -28, 54, 24.8, 6.14 },
-    { 18, 11, 58.20, -28, 54,  5.0, 6.51 },
-    { 23,  1, 19.39, -28, 51, 13.0, 5.55 },
-    {  9, 23, 12.31, -28, 50,  2.0, 4.69 },
-    { 23,  8, 21.00, -28, 49, 23.9, 5.60 },
-    {  8, 59, 15.70, -28, 48, 22.0, 6.25 },
-    {  3, 18,  2.81, -28, 47, 48.8, 5.91 },
-    { 19, 49, 11.59, -28, 47, 20.0, 6.05 },
-    {  9, 26, 44.81, -28, 47, 15.0, 6.10 },
-    {  6, 24, 43.90, -28, 46, 48.0, 6.39 },
-    { 21, 18, 54.41, -28, 45, 56.2, 6.40 },
-    { 17, 58, 39.10, -28, 45, 33.1, 6.01 },
-    { 22, 38, 44.69, -28, 44, 52.1, 6.47 },
-    { 11,  6, 38.71, -28, 43, 40.1, 6.77 },
-    {  5, 36, 10.30, -28, 42, 28.1, 6.26 },
-    { 13, 32, 35.90, -28, 41, 34.1, 5.69 },
-    {  5, 37, 44.59, -28, 41, 21.8, 5.31 },
-    { 20, 25, 26.81, -28, 39, 47.9, 5.85 },
-    { 18, 17, 24.00, -28, 39,  9.0, 6.19 },
-    {  5, 47,  4.70, -28, 38, 21.1, 6.22 },
-    { 19,  7, 30.91, -28, 38, 12.8, 6.04 },
-    {  9, 32, 18.50, -28, 37, 41.2, 6.46 },
-    {  8, 50, 21.60, -28, 37,  5.2, 6.17 },
-    { 16, 18, 17.90, -28, 36, 50.0, 4.78 },
-    { 10, 12,  2.90, -28, 36, 23.0, 6.28 },
-    { 13, 54, 16.61, -28, 34, 10.9, 6.04 },
-    {  6, 53, 33.91, -28, 32, 22.9, 6.04 },
-    { 16, 45,   .19, -28, 30, 34.9, 6.02 },
-    {  7,  0, 42.60, -28, 29, 21.8, 6.27 },
-    { 11, 55, 40.10, -28, 28, 36.8, 5.93 },
-    { 18,  8,  4.99, -28, 27, 25.9, 4.57 },
-    { 22,  0, 50.21, -28, 27, 13.0, 5.42 },
-    { 18, 22,   .19, -28, 25, 48.0, 6.16 },
-    { 16, 12, 15.91, -28, 25,  3.0, 5.67 },
-    {  7, 43, 32.40, -28, 24, 40.0, 4.59 },
-    {  7, 35, 22.80, -28, 22,  9.8, 4.64 },
-    { 22, 39, 43.99, -28, 19, 31.1, 6.31 },
-    { 12, 44,   .50, -28, 19, 26.0, 5.48 },
-    { 22, 10,   .10, -28, 17, 33.0, 6.44 },
-    { 18, 17, 23.71, -28, 17, 21.1, 6.40 },
-    { 10, 31, 48.60, -28, 14, 15.0, 6.05 },
-    {  2, 33, 50.71, -28, 13, 57.0, 4.90 },
-    { 16, 35, 52.99, -28, 12, 58.0, 2.82 },
-    { 15, 38, 15.70, -28, 12, 24.1, 6.32 },
-    { 17, 23, 21.60, -28,  8, 35.2, 5.35 },
-    { 15, 37,  1.51, -28,  8,  6.0, 3.58 },
-    { 23, 48, 55.61, -28,  7, 49.1, 4.57 },
-    { 13, 31, 33.29, -28,  6, 46.1, 6.47 },
-    {  3,  1, 37.70, -28,  5, 30.1, 5.89 },
-    { 23,  9, 44.59, -28,  5, 19.0, 5.87 },
-    {  4, 46, 25.80, -28,  5, 15.0, 6.19 },
-    { 11,  8, 43.90, -28,  4, 50.2, 5.44 },
-    { 17, 56, 41.90, -28,  3, 55.1, 5.80 },
-    { 15, 46, 12.79, -28,  3, 42.1, 6.51 },
-    { 15,  2,  6.41, -28,  3, 38.2, 5.85 },
-    { 15, 34, 37.30, -28,  2, 48.8, 5.15 },
-    {  0,  9, 21.00, -27, 59, 16.1, 5.42 },
-    { 14, 50, 17.30, -27, 57, 37.1, 4.41 },
-    {  7, 40, 43.39, -27, 56, 44.9, 6.76 },
-    {  3, 38, 47.69, -27, 56, 35.2, 6.01 },
-    {  2, 49, 54.19, -27, 56, 30.1, 5.39 },
-    {  7,  1, 43.10, -27, 56,  4.9, 3.47 },
-    { 16, 12, 18.19, -27, 55, 35.0, 4.59 },
-    { 20, 54,  6.79, -27, 55, 32.2, 6.41 },
-    { 17, 43, 17.81, -27, 53,  3.1, 6.36 },
-    {  7, 16, 34.99, -27, 52, 52.0, 4.64 },
-    {  5, 37, 16.49, -27, 52, 17.0, 6.16 },
-    { 19, 24, 30.10, -27, 51, 56.2, 6.04 },
-    {  7, 23, 29.09, -27, 50,  3.1, 5.38 },
-    {  3,  7, 50.90, -27, 49, 52.0, 6.19 },
-    { 17, 47, 33.60, -27, 49, 50.9, 4.54 },
-    {  0, 11, 34.39, -27, 47, 58.9, 5.41 },
-    {  0, 55, 55.49, -27, 46, 32.2, 6.10 },
-    {  6, 30, 46.30, -27, 46,  9.8, 5.93 },
-    {  9, 44, 12.10, -27, 46,  9.8, 4.79 },
-    { 22, 14, 18.79, -27, 46,   .8, 5.43 },
-    { 17, 12, 25.01, -27, 45, 42.8, 6.14 },
-    { 14, 23,  5.81, -27, 45, 14.0, 4.77 },
-    { 12, 25, 18.41, -27, 44, 57.1, 6.09 },
-    { 21,  3, 10.20, -27, 43, 54.8, 6.25 },
-    {  8, 50, 31.90, -27, 42, 36.0, 4.01 },
-    { 20,  2, 39.50, -27, 42, 34.9, 4.58 },
-    {  8, 55, 31.51, -27, 40, 54.8, 4.89 },
-    { 19,  6, 56.40, -27, 40, 14.2, 3.32 },
-    { 14, 58, 39.19, -27, 39, 25.9, 5.65 },
-    {  4,  5, 37.39, -27, 39,  6.1, 5.59 },
-    { 21, 13, 17.30, -27, 37,  9.8, 5.42 },
-    { 12, 48, 26.40, -27, 35, 51.0, 5.66 },
-    {  6, 57, 42.41, -27, 32, 15.0, 6.23 },
-    {  7, 10, 19.39, -27, 29, 29.0, 5.46 },
-    {  9, 56, 54.00, -27, 28, 30.0, 6.32 },
-    {  7, 12, 24.10, -27, 28, 27.1, 6.59 },
-    { 16, 44, 17.30, -27, 27, 22.0, 6.58 },
-    { 14,  2, 22.80, -27, 25, 48.0, 5.48 },
-    { 10, 37, 13.70, -27, 24, 45.0, 4.89 },
-    {  5, 19, 23.69, -27, 22,  8.0, 5.99 },
-    {  7, 13, 36.31, -27, 21, 23.0, 6.12 },
-    {  1, 46,  1.01, -27, 20, 57.1, 6.39 },
-    {  6, 44, 51.89, -27, 20, 29.0, 6.45 },
-    { 15, 54, 30.00, -27, 20, 19.0, 6.14 },
-    {  6, 50,  6.00, -27, 20,  2.0, 7.04 },
-    {  8, 29, 27.60, -27, 19, 57.0, 6.70 },
-    {  9, 52, 58.01, -27, 19, 55.9, 6.30 },
-    {  3, 26, 22.51, -27, 19,  3.0, 5.93 },
-    { 11,  5, 19.90, -27, 17, 37.0, 4.94 },
-    { 11,  5, 57.60, -27, 17, 16.1, 5.71 },
-    { 11, 50, 37.10, -27, 16, 40.1, 6.48 },
-    { 14, 12, 46.01, -27, 15, 40.0, 5.08 },
-    { 20, 45, 13.20, -27, 14, 49.9, 6.50 },
-    { 19, 56, 56.81, -27, 10, 12.0, 4.52 },
-    {  6, 58,  7.61, -27,  9, 52.9, 6.37 },
-    {  6, 10, 34.61, -27,  9, 15.1, 5.72 },
-    { 12, 37, 42.19, -27,  8, 20.0, 5.45 },
-    { 22, 29, 46.01, -27,  6, 25.9, 5.95 },
-    { 22, 40, 39.41, -27,  2, 37.0, 4.17 },
-    { 18, 18,  3.19, -27,  2, 33.0, 4.65 },
-    { 23, 54, 21.41, -27,  2, 31.9, 6.35 },
-    {  7, 14, 51.10, -27,  2, 17.2, 5.58 },
-    { 20, 15, 17.40, -27,  1, 58.1, 5.73 },
-    { 10, 13, 19.39, -27,  1, 44.0, 6.25 },
-    {  7, 34, 34.90, -27,  0, 42.8, 5.77 },
-    { 18, 45, 39.41, -26, 59, 26.9, 3.17 },
-    { 23, 21, 15.50, -26, 59, 12.1, 5.64 },
-    { 19, 29, 52.20, -26, 59,  8.2, 5.52 },
-    { 17, 48, 27.79, -26, 58, 30.0, 6.35 },
-    {  7, 20, 55.01, -26, 57, 49.0, 6.01 },
-    {  6, 53,   .10, -26, 57, 27.0, 6.40 },
-    {  5, 15, 24.29, -26, 56, 35.9, 5.07 },
-    { 20, 51, 49.30, -26, 55,  9.1, 4.11 },
-    { 21,  1, 45.31, -26, 52, 52.0, 6.05 },
-    {  7, 39, 26.90, -26, 51, 47.2, 6.50 },
-    { 14, 25, 47.69, -26, 51,  9.0, 6.48 },
-    {  8, 35, 28.80, -26, 50, 37.0, 5.96 },
-    { 11,  2, 24.41, -26, 49, 53.0, 6.23 },
-    { 22,  4, 36.79, -26, 49, 21.0, 5.96 },
-    {  7, 38, 49.80, -26, 48, 13.0, 4.62 },
-    {  7, 38, 49.30, -26, 48,  6.1, 4.50 },
-    {  7, 17, 47.90, -26, 47, 51.0, 6.46 },
-    {  7, 14, 48.70, -26, 46, 22.1, 3.85 },
-    {  9,  8, 43.49, -26, 46,  4.1, 6.15 },
-    { 18, 28,  6.19, -26, 45, 25.9, 6.27 },
-    { 11, 48, 45.10, -26, 44, 58.9, 5.11 },
-    { 11, 32, 23.30, -26, 44, 48.1, 6.16 },
-    { 12, 51, 57.91, -26, 44, 17.2, 6.15 },
-    {  5, 23, 12.00, -26, 42, 20.9, 6.49 },
-    {  6,  9, 47.21, -26, 42,  2.9, 6.27 },
-    { 14,  6, 22.30, -26, 40, 57.0, 3.27 },
-    { 10, 36,  4.61, -26, 40, 30.0, 6.29 },
-    {  9,  1, 11.40, -26, 39, 50.0, 6.20 },
-    {  7,  7,   .10, -26, 39, 28.1, 6.62 },
-    { 18, 52, 28.49, -26, 39,  1.1, 6.29 },
-    { 14, 47, 57.50, -26, 38, 47.0, 5.77 },
-    { 20, 40, 36.00, -26, 38, 42.0, 6.51 },
-    { 18, 27, 43.80, -26, 38,  4.9, 6.31 },
-    { 23, 57,  8.30, -26, 37, 25.0, 6.26 },
-    { 14, 13, 13.20, -26, 36, 43.9, 6.24 },
-    {  3, 20, 45.19, -26, 36, 23.0, 6.39 },
-    { 17, 15, 21.00, -26, 36, 10.1, 5.11 },
-    { 17, 15, 20.81, -26, 36,  5.0, 5.07 },
-    {  9, 29, 54.50, -26, 35, 22.9, 5.48 },
-    {  7, 18, 51.19, -26, 35,  8.9, 5.28 },
-    { 18, 28, 57.41, -26, 34, 54.1, 6.50 },
-    { 13, 11, 39.19, -26, 33,  6.1, 6.50 },
-    {  9, 56, 46.51, -26, 33,  1.1, 6.28 },
-    { 16, 31, 22.80, -26, 32, 16.1, 6.10 },
-    { 17,  6, 53.21, -26, 30, 47.2, 6.29 },
-    { 13, 36, 48.41, -26, 29, 42.0, 5.78 },
-    { 10, 30, 51.41, -26, 29,  2.0, 6.51 },
-    {  6, 11, 13.51, -26, 28, 55.9, 6.09 },
-    { 12, 56, 30.10, -26, 27, 37.1, 6.62 },
-    { 16, 29, 24.41, -26, 25, 54.8, 0.96 },
-    {  7,  8, 23.50, -26, 23, 35.9, 1.84 },
-    { 21, 19, 45.79, -26, 21, 11.2, 6.56 },
-    {  7, 14, 15.19, -26, 21,  9.0, 4.66 },
-    {  7, 42, 48.10, -26, 21,  4.0, 5.64 },
-    {  8, 22, 49.90, -26, 20, 53.2, 5.90 },
-    { 15, 10, 18.60, -26, 19, 58.1, 5.76 },
-    { 22, 12, 57.50, -26, 19, 40.1, 6.17 },
-    { 16,  8,  7.61, -26, 19, 36.1, 5.38 },
-    { 19, 55, 50.40, -26, 17, 57.8, 4.70 },
-    { 18, 55, 15.91, -26, 17, 48.1, 2.02 },
-    { 20, 56, 47.30, -26, 17, 47.0, 5.70 },
-    {  0, 13, 44.21, -26, 17,  4.9, 6.31 },
-    {  6,  3, 15.50, -26, 17,  3.8, 5.04 },
-    { 15, 37, 28.49, -26, 16, 48.0, 6.19 },
-    {  5,  2,  9.79, -26, 16, 30.0, 5.02 },
-    { 17, 31, 44.40, -26, 16, 10.9, 6.05 },
-    { 15, 55, 30.10, -26, 15, 56.9, 5.62 },
-    {  8, 37, 52.20, -26, 15, 18.0, 5.27 },
-    { 23, 44, 28.90, -26, 14, 47.0, 6.17 },
-    {  1, 30, 22.90, -26, 12, 28.1, 5.93 },
-    { 19, 58, 57.19, -26, 11, 44.2, 4.83 },
-    { 15, 13, 53.30, -26, 11, 37.0, 5.84 },
-    { 21, 36, 10.99, -26, 10, 17.0, 5.73 },
-    {  5,  5, 16.20, -26,  9,  9.0, 5.73 },
-    {  8, 27, 53.50, -26,  7, 57.0, 6.62 },
-    {  7, 34, 28.80, -26,  7,   .1, 6.65 },
-    { 13, 45, 36.89, -26,  6, 58.0, 5.81 },
-    { 15, 58, 51.10, -26,  6, 51.1, 2.89 },
-    {  3, 15,   .19, -26,  6,  1.1, 6.25 },
-    { 14, 47, 44.81, -26,  5, 15.0, 5.24 },
-    { 22, 30, 53.71, -26,  4, 25.0, 6.43 },
-    {  0, 13, 42.10, -26,  1, 18.8, 5.94 },
-    { 20, 41, 24.10, -26,  0,   .0, 6.28 },
-    {  9, 21, 29.59, -25, 57, 56.2, 4.72 },
-    {  2, 18, 58.51, -25, 56, 44.2, 6.34 },
-    { 17, 26, 55.20, -25, 56, 35.9, 6.44 },
-    {  7, 12, 12.19, -25, 56, 33.0, 5.92 },
-    {  7, 48,  5.21, -25, 56, 13.9, 4.50 },
-    {  9, 54, 12.31, -25, 55, 57.0, 4.88 },
-    { 22, 47, 56.21, -25, 54, 42.8, 6.30 },
-    {  5, 10, 44.50, -25, 54, 33.8, 6.41 },
-    { 11, 58, 54.41, -25, 54, 32.0, 6.43 },
-    { 19, 13, 13.70, -25, 54, 24.1, 5.80 },
-    { 22, 16, 37.39, -25, 53, 53.9, 6.15 },
-    {  7, 21,  4.30, -25, 53, 29.0, 5.87 },
-    { 16,  3, 20.59, -25, 51, 55.1, 5.00 },
-    {  9,  8,  2.90, -25, 51, 29.9, 4.58 },
-    {  6, 27, 11.21, -25, 51, 24.1, 6.07 },
-    {  2, 24, 20.11, -25, 50, 51.0, 6.44 },
-    { 14, 19,   .79, -25, 48, 56.2, 5.87 },
-    { 15,  5, 47.69, -25, 47, 22.9, 6.67 },
-    { 20, 49, 17.59, -25, 46, 53.0, 5.86 },
-    {  6, 50, 36.89, -25, 46, 41.2, 6.33 },
-    { 15, 50, 58.70, -25, 45,  5.0, 4.64 },
-    {  4, 21, 31.30, -25, 43, 41.9, 6.01 },
-    {  4, 55, 30.19, -25, 43, 40.1, 6.72 },
-    { 11, 54, 42.50, -25, 42, 50.0, 5.30 },
-    { 23,  0, 24.60, -25, 37, 36.1, 6.29 },
-    { 14, 47, 22.51, -25, 37, 27.8, 5.63 },
-    {  3, 31, 53.90, -25, 36, 51.1, 6.38 },
-    { 18, 18, 41.69, -25, 36, 16.9, 6.51 },
-    { 16, 21, 11.30, -25, 35, 34.1, 2.89 },
-    {  3, 22, 16.30, -25, 35, 16.1, 6.35 },
-    {  6, 23, 55.90, -25, 34, 40.1, 5.63 },
-    {  0, 27, 14.71, -25, 32, 49.9, 5.98 },
-    { 16, 46, 51.29, -25, 31, 43.0, 6.71 },
-    {  9,  3,  8.81, -25, 30, 15.8, 6.74 },
-    {  7, 43, 39.10, -25, 30, 14.0, 6.55 },
-    { 13, 44, 45.70, -25, 30,  2.9, 6.21 },
-    { 16, 14, 53.59, -25, 28, 36.8, 6.05 },
-    { 18,  8, 54.10, -25, 28, 21.0, 6.61 },
-    { 14, 46,   .10, -25, 26, 35.2, 4.94 },
-    { 18, 27, 58.20, -25, 25, 18.1, 2.81 },
-    {  6,  1, 13.10, -25, 25,  4.1, 6.05 },
-    {  6, 58, 35.90, -25, 24, 50.0, 5.59 },
-    {  8, 45, 49.30, -25, 23, 15.0, 6.10 },
-    {  7, 38, 18.00, -25, 21, 52.9, 4.70 },
-    { 23, 49, 49.61, -25, 19, 53.0, 6.42 },
-    { 15, 53, 36.70, -25, 19, 37.9, 4.59 },
-    { 10,  3, 41.40, -25, 19,   .1, 6.70 },
-    { 15, 13, 28.70, -25, 18, 33.1, 6.45 },
-    {  9, 37,   .19, -25, 17, 48.1, 5.70 },
-    { 15,  4,  4.20, -25, 16, 54.8, 3.29 },
-    {  2, 59, 36.10, -25, 16, 27.1, 5.71 },
-    { 20, 46,  5.69, -25, 16, 14.9, 4.14 },
-    { 19, 15, 32.40, -25, 15, 24.1, 4.85 },
-    { 18, 29, 22.01, -25, 15, 23.0, 6.59 },
-    { 17, 12, 13.61, -25, 15, 16.9, 6.54 },
-    { 15, 54, 39.50, -25, 14, 37.0, 5.87 },
-    {  7,  9, 42.89, -25, 13, 52.0, 5.69 },
-    {  7, 25, 25.30, -25, 13,  4.1, 5.78 },
-    {  7,  1,  5.90, -25, 12, 55.1, 5.63 },
-    {  2, 30, 13.80, -25, 11, 11.0, 6.51 },
-    { 18, 19, 58.00, -25, 11,  3.0,      },
-    { 22, 13, 44.40, -25, 10, 50.9, 5.58 },
-    { 23,  0,  5.81, -25,  9, 51.1, 5.65 },
-    { 16, 30, 12.41, -25,  6, 54.0, 4.79 },
-    { 20, 37, 52.10, -25,  6, 32.0, 6.36 },
-    { 21, 41, 46.10, -25,  6,  6.8, 6.49 },
-    { 16, 59, 57.60, -25,  5, 30.8, 5.86 },
-    {  1, 45, 38.81, -25,  3,  9.0, 5.31 },
-    {  1, 38, 49.99, -25,  1, 18.8, 6.70 },
-    { 18, 44, 49.61, -25,  0, 40.0, 5.83 },
-    { 14,  0,   .10, -25,  0, 37.1, 5.77 },
-    { 21,  7,  7.70, -25,  0, 20.9, 4.50 },
-    { 17, 22,   .60, -24, 59, 57.8, 3.27 },
-    { 14, 43, 13.61, -24, 59, 51.0, 5.73 },
-    { 17,  0,  9.50, -24, 59, 21.1, 5.75 },
-    { 13, 58, 31.10, -24, 58, 19.9, 5.15 },
-    {  7,  6, 52.30, -24, 57, 38.2, 6.08 },
-    {  7, 18, 42.41, -24, 57, 15.1, 4.40 },
-    { 20, 32, 52.39, -24, 56, 38.0, 6.36 },
-    { 19,  0, 24.79, -24, 56, 31.9, 6.36 },
-    { 18, 21, 31.39, -24, 54, 54.0, 6.25 },
-    {  7, 49,  1.70, -24, 54, 43.9, 5.33 },
-    {  4, 23,  5.71, -24, 53, 31.9, 5.83 },
-    { 17, 54, 54.00, -24, 53, 13.9, 6.20 },
-    { 19, 36, 42.41, -24, 53,  1.0, 4.60 },
-    { 18, 58, 20.50, -24, 52, 36.1, 6.62 },
-    {  7, 49, 17.71, -24, 51, 34.9, 3.34 },
-    { 12, 47, 53.71, -24, 51,  6.1, 6.44 },
-    { 19,  2, 27.70, -24, 50, 48.8, 5.65 },
-    { 12, 23, 21.60, -24, 50, 26.2, 5.68 },
-    { 15, 58, 34.80, -24, 49, 53.0, 5.43 },
-    { 14, 24, 48.60, -24, 48, 23.0, 5.32 },
-    {  0, 53, 12.41, -24, 46, 36.8, 6.46 },
-    {  5, 21, 46.20, -24, 46, 23.2, 5.06 },
-    {  0, 37, 20.71, -24, 46,  1.9, 5.57 },
-    { 22, 23, 30.91, -24, 45, 45.0, 5.53 },
-    { 23, 56, 29.90, -24, 44, 13.9, 6.31 },
-    { 12,  8, 24.79, -24, 43, 44.0, 4.02 },
-    { 16,  3, 54.70, -24, 43, 35.0, 6.21 },
-    { 11, 39,   .41, -24, 43, 16.0, 6.42 },
-    { 19, 36,  1.70, -24, 43,  9.1, 5.65 },
-    {  7, 33,  9.70, -24, 42, 38.9, 5.85 },
-    {  9, 36, 33.70, -24, 42, 10.1, 6.53 },
-    {  7, 44, 34.01, -24, 40, 26.0, 5.62 },
-    { 19,  8, 14.59, -24, 39, 24.8, 6.30 },
-    { 14, 54, 20.11, -24, 38, 31.9, 5.30 },
-    {  6, 57, 33.91, -24, 37, 50.2, 5.46 },
-    {  3, 53, 42.60, -24, 36, 45.0, 4.65 },
-    {  8, 33,  4.80, -24, 36, 23.0, 6.19 },
-    { 21, 32, 33.31, -24, 35, 26.2, 6.43 },
-    {  2, 49, 51.00, -24, 33, 37.1, 6.14 },
-    {  7, 18, 40.30, -24, 33, 32.0, 4.98 },
-    {  6, 53, 55.30, -24, 32, 21.1, 6.21 },
-    { 15, 53, 53.81, -24, 31, 59.2, 5.39 },
-    {  7, 51,   .00, -24, 31, 41.9, 6.45 },
-    { 19, 25, 16.51, -24, 30, 31.0, 5.03 },
-    { 15, 33,  9.10, -24, 29, 21.8, 7.00 },
-    {  4, 40,  6.79, -24, 28, 57.0, 5.58 },
-    { 16, 41, 36.19, -24, 28,  5.2, 6.09 },
-    { 11, 29, 38.59, -24, 27, 47.9, 5.76 },
-    { 16,  7, 51.89, -24, 27, 42.8, 6.33 },
-    { 16, 13, 45.70, -24, 25, 18.8, 6.41 },
-    { 13, 51, 20.40, -24, 23, 26.9, 6.45 },
-    {  5,  3, 53.30, -24, 23, 16.1, 5.61 },
-    { 14, 12, 24.50, -24, 21, 51.1, 6.34 },
-    { 18,  3, 52.39, -24, 21, 38.2, 5.97 },
-    {  2,  9, 34.80, -24, 20, 44.9, 6.48 },
-    {  8,  7, 32.59, -24, 18, 15.1, 2.81 },
-    { 17, 18,   .70, -24, 17, 12.8, 5.20 },
-    { 10,  4, 21.00, -24, 17,  8.2, 5.70 },
-    { 17, 18,   .50, -24, 17,  3.1, 6.80 },
-    { 18,  2, 51.10, -24, 16, 55.9, 5.34 },
-    { 14, 49, 18.70, -24, 15,  6.1, 5.68 },
-    { 17, 25,  6.19, -24, 14, 37.0, 6.19 },
-    { 23, 53, 20.81, -24, 13, 45.1, 6.24 },
-    { 18, 34, 32.81, -24, 13, 21.0, 6.51 },
-    {  6,  5, 45.70, -24, 11, 44.2, 6.95 },
-    {  6, 54,  7.90, -24, 11,  2.0, 3.87 },
-    { 19, 15, 33.19, -24, 10, 45.1, 6.25 },
-    { 17, 26, 22.20, -24, 10, 31.1, 4.17 },
-    { 16, 20, 38.21, -24, 10,  9.8, 4.55 },
-    { 23, 41,  7.01, -24,  9, 37.1, 6.60 },
-    {  0,  3,  7.70, -24,  8, 43.1, 6.44 },
-    {  0, 49, 13.90, -24,  8, 11.0, 5.90 },
-    {  3, 19, 34.80, -24,  7, 23.2, 5.61 },
-    {  4, 26, 57.00, -24,  4, 53.0, 6.11 },
-    {  6, 49, 43.99, -24,  4, 32.9, 6.33 },
-    {  8, 25,  3.70, -24,  2, 46.0, 5.28 },
-    {  7,  8, 49.30, -24,  2, 39.1, 6.65 },
-    { 18, 33, 53.50, -24,  1, 57.0, 5.49 },
-    {  3, 59, 55.51, -24,  0, 59.0, 4.66 },
-    { 15, 13, 17.50, -24,  0, 29.9, 6.47 },
-    {  0, 52, 40.61, -24,  0, 20.9, 5.46 },
-    {  1,  7, 13.10, -23, 59, 47.0, 6.37 },
-    {  1,  6,  7.70, -23, 59, 33.0, 6.14 },
-    { 22, 35, 36.50, -23, 59, 28.0, 5.97 },
-    { 15, 53, 55.80, -23, 58, 41.2, 5.42 },
-    { 17, 31, 25.01, -23, 57, 46.1, 4.81 },
-    { 19, 25, 29.69, -23, 57, 43.9, 5.43 },
-    {  9, 59,  6.10, -23, 57,  1.1, 6.21 },
-    { 19, 54, 17.71, -23, 56, 28.0, 6.18 },
-    {  6, 54, 13.01, -23, 55, 41.9, 6.91 },
-    {  9, 42, 14.40, -23, 54, 56.2, 4.94 },
-    {  3, 47, 39.60, -23, 52, 28.9, 5.24 },
-    {  6, 13, 45.10, -23, 51, 42.8, 6.39 },
-    {  2, 57, 23.71, -23, 51, 42.8, 5.45 },
-    {  7,  7, 22.61, -23, 50, 25.1, 5.71 },
-    { 18, 41, 51.60, -23, 49, 59.9, 6.23 },
-    {  7,  3,  1.49, -23, 49, 59.9, 3.02 },
-    {  8, 55, 55.90, -23, 49,  5.9, 6.39 },
-    { 15, 40, 16.90, -23, 49,  5.2, 4.96 },
-    {  2, 22, 32.59, -23, 48, 59.0, 5.20 },
-    { 17, 59, 47.59, -23, 48, 58.0, 4.76 },
-    {  0, 40, 32.90, -23, 48, 15.8, 6.14 },
-    {  0, 30, 22.70, -23, 47, 16.1, 5.19 },
-    { 20, 53,  1.20, -23, 46, 59.2, 6.33 },
-    {  7, 37, 16.80, -23, 46, 30.0, 6.37 },
-    { 20, 40, 11.69, -23, 46, 26.0, 6.37 },
-    { 10, 34,   .91, -23, 44, 43.1, 5.08 },
-    { 23,  6, 40.90, -23, 44, 35.2, 4.47 },
-    {  7, 15, 47.50, -23, 44, 26.2, 6.32 },
-    {  3, 10, 35.40, -23, 44, 17.9, 6.38 },
-    {  7, 26, 40.70, -23, 42, 43.9, 6.56 },
-    { 10, 21, 28.70, -23, 42, 38.9, 6.50 },
-    { 18, 11, 43.39, -23, 42,  4.0, 4.98 },
-    { 12, 30, 17.50, -23, 41, 48.1, 5.63 },
-    {  6, 39, 36.31, -23, 41, 44.2, 6.05 },
-    { 16,  8, 43.70, -23, 41,  8.2, 5.88 },
-    { 22, 26, 10.70, -23, 40, 57.0, 6.29 },
-    {  3, 21, 24.00, -23, 38,  7.1, 5.52 },
-    {  3,  2, 23.50, -23, 37, 27.8, 4.09 },
-    { 16,  6,  6.29, -23, 36, 23.0, 5.92 },
-    {  2, 58,  5.71, -23, 36, 22.0, 5.84 },
-    { 12, 11,  3.91, -23, 36,  9.0, 5.46 },
-    {  9, 41, 16.99, -23, 35, 30.1, 4.77 },
-    { 18, 38, 30.70, -23, 30, 18.0, 5.81 },
-    {  7, 34, 19.10, -23, 28, 28.9, 5.87 },
-    {  7, 34, 18.60, -23, 28, 25.0, 5.83 },
-    {  6, 45, 23.30, -23, 27, 42.8, 6.05 },
-    { 21, 35, 15.91, -23, 27, 15.1, 6.40 },
-    { 13, 41, 30.91, -23, 26, 58.9, 6.59 },
-    { 16, 25, 35.21, -23, 26, 49.9, 5.02 },
-    { 16, 25, 35.11, -23, 26, 46.0, 5.92 },
-    { 19, 40,  7.10, -23, 25, 43.0, 5.97 },
-    { 19, 39, 49.39, -23, 25, 40.1, 6.34 },
-    {  6, 31, 51.31, -23, 25,  5.9, 4.33 },
-    { 12, 34, 23.21, -23, 23, 48.1, 2.65 },
-    {  0, 49, 33.41, -23, 21, 42.1, 6.28 },
-    { 12, 15, 46.99, -23, 21, 13.0, 6.54 },
-    {  9, 29, 49.90, -23, 20, 43.1, 6.24 },
-    {  7, 16, 36.79, -23, 18, 56.2, 4.79 },
-    {  7, 59,  5.71, -23, 18, 38.2, 5.11 },
-    { 13, 29, 42.79, -23, 16, 53.0, 4.97 },
-    { 21, 42,   .79, -23, 15, 46.1, 5.24 },
-    {  3, 46, 50.90, -23, 14, 58.9, 4.23 },
-    {  5, 56, 34.51, -23, 12, 56.2, 6.36 },
-    {  9, 10, 22.99, -23, 10, 36.1, 6.53 },
-    { 10, 34, 57.70, -23, 10, 34.0, 6.10 },
-    { 18, 56,   .60, -23, 10, 25.0, 5.93 },
-    { 13, 18, 55.30, -23, 10, 18.1, 3.00 },
-    {  8, 24, 55.10, -23,  9, 13.0, 5.68 },
-    { 14, 46,  6.79, -23,  9, 11.2, 5.81 },
-    { 15, 39, 21.29, -23,  9,  1.1, 6.34 },
-    { 16, 56, 48.00, -23,  9,   .0, 5.58 },
-    { 15, 37, 48.10, -23,  8, 30.1, 5.78 },
-    { 22, 16, 59.81, -23,  8, 24.0, 6.17 },
-    { 13,  9,  3.29, -23,  7,  5.2, 4.95 },
-    {  6,  6, 31.99, -23,  6, 38.2, 5.47 },
-    {  0,  6, 50.11, -23,  6, 27.0, 6.18 },
-    {  7, 26, 59.40, -23,  5, 10.0, 5.61 },
-    {  8, 28, 35.90, -23,  4, 18.1, 6.51 },
-    {  7, 29, 51.41, -23,  1, 27.8, 4.85 },
-    { 13, 57, 27.70, -23,  1, 22.1, 6.14 },
-    {  5, 49, 53.50, -22, 58, 18.1, 5.87 },
-    {  4, 18, 37.39, -22, 58, 13.1, 6.07 },
-    {  6, 35,  3.41, -22, 57, 52.9, 4.54 },
-    {  6, 55, 46.80, -22, 56, 29.0, 5.30 },
-    {  5, 51, 28.61, -22, 55, 34.0, 6.17 },
-    {  8, 20, 27.41, -22, 55, 28.9, 6.13 },
-    {  7, 24, 17.21, -22, 54, 46.1, 6.19 },
-    {  7, 13, 48.29, -22, 54, 23.0, 6.36 },
-    {  7, 56, 51.50, -22, 52, 48.0, 4.20 },
-    {  9, 33, 26.21, -22, 51, 50.0, 5.91 },
-    {  7, 27, 42.89, -22, 51, 34.9, 5.95 },
-    {  7, 20, 53.21, -22, 51,  6.1, 6.61 },
-    {  0, 36,  6.91, -22, 50, 33.0, 6.06 },
-    {  5, 56, 14.30, -22, 50, 25.1, 5.96 },
-    { 11, 11, 39.50, -22, 49, 32.9, 4.48 },
-    {  5,  2, 44.90, -22, 47, 42.0, 5.75 },
-    { 23,  1, 22.99, -22, 47, 26.9, 6.28 },
-    { 18,  1, 54.41, -22, 46, 50.2, 5.77 },
-    {  6,  9, 47.90, -22, 46, 27.1, 5.71 },
-    { 12, 57, 33.19, -22, 45, 14.0, 6.31 },
-    { 21, 24,  7.90, -22, 44, 48.8, 6.38 },
-    { 18, 54, 10.20, -22, 44, 42.0, 4.83 },
-    { 20,  1, 23.90, -22, 44, 13.9, 6.01 },
-    { 18,  3,  1.70, -22, 43,  5.9, 6.74 },
-    {  6, 17,  3.50, -22, 42, 54.0, 6.07 },
-    { 19,  1, 37.80, -22, 41, 44.2, 6.24 },
-    {  2, 29, 55.39, -22, 40, 58.1, 6.77 },
-    {  7, 13, 23.90, -22, 40, 23.9, 6.01 },
-    { 18, 55,  7.10, -22, 40, 17.0, 4.99 },
-    { 21, 23,   .50, -22, 40,  8.0, 5.60 },
-    {  8, 39,  7.99, -22, 39, 42.8, 5.05 },
-    { 16,  0, 19.99, -22, 37, 18.1, 2.32 },
-    { 12, 10,  7.49, -22, 37, 10.9, 3.00 },
-    {  6, 36, 40.90, -22, 36, 54.0, 6.35 },
-    { 20,  3, 44.30, -22, 35, 44.2, 6.45 },
-    {  2, 30, 32.81, -22, 32, 44.2, 6.10 },
-    { 18, 58, 24.60, -22, 31, 45.8, 6.14 },
-    { 10, 21, 36.00, -22, 31, 41.9, 6.51 },
-    {  1, 56, 40.20, -22, 31, 36.8, 4.85 },
-    {  0, 46, 11.81, -22, 31, 18.8, 5.50 },
-    {  7, 47, 12.50, -22, 31, 10.9, 5.90 },
-    {  3, 18, 22.10, -22, 30, 41.0, 4.88 },
-    {  0,  7, 46.80, -22, 30, 32.0, 5.94 },
-    {  9, 54, 31.70, -22, 29, 17.9, 6.24 },
-    {  2, 47, 11.21, -22, 29,  8.2, 6.47 },
-    { 17, 47, 45.60, -22, 28, 41.2, 6.18 },
-    { 23,  9, 54.79, -22, 27, 27.0, 4.69 },
-    {  6, 42, 45.79, -22, 26, 57.1, 6.13 },
-    {  5, 44, 27.79, -22, 26, 53.9, 3.60 },
-    {  6,  8, 57.89, -22, 25, 39.0, 5.50 },
-    { 14,  3, 53.11, -22, 25, 18.1, 6.30 },
-    {  5, 44, 26.50, -22, 25, 18.1, 6.15 },
-    { 21, 26, 40.01, -22, 24, 41.0, 3.74 },
-    { 19, 20, 38.11, -22, 24,  9.0, 5.58 },
-    { 15, 16, 22.99, -22, 23, 57.8, 5.50 },
-    { 18, 46, 20.59, -22, 23, 31.9, 5.37 },
-    { 20, 29, 31.30, -22, 23, 30.1, 6.16 },
-    {  2, 53, 35.30, -22, 22, 35.0, 5.95 },
-    {  5, 42, 13.90, -22, 22, 25.0, 5.87 },
-    {  5,  5, 27.70, -22, 22, 16.0, 3.19 },
-    {  9, 27, 18.41, -22, 20, 38.0, 4.69 },
-    {  7, 41, 23.59, -22, 20, 13.9, 6.18 },
-    {  7, 34,  3.19, -22, 17, 46.0, 4.45 },
-    { 12, 20, 33.70, -22, 12, 56.9, 5.21 },
-    {  6, 57, 14.81, -22, 12, 11.9, 6.61 },
-    { 12, 20, 10.70, -22, 10, 32.2, 5.97 },
-    { 18, 50, 50.50, -22,  9, 43.9, 6.61 },
-    {  7, 36,  7.80, -22,  9, 38.2, 6.34 },
-    {  7,  0, 19.30, -22,  7,  9.8, 6.53 },
-    { 17, 35, 18.50, -22,  2, 38.0, 6.57 },
-    {  7,  4, 47.11, -22,  1, 55.9, 6.09 },
-    { 15,  6, 27.10, -22,  1, 54.8, 6.17 },
-    {  0, 44, 44.40, -22,  0, 22.0, 5.24 },
-    {  7, 25, 19.90, -21, 58, 58.1, 6.05 },
-    { 12,  0, 42.50, -21, 50, 13.9, 6.28 },
-    {  6,  6, 57.60, -21, 48, 46.1, 5.78 },
-    { 20, 18,  1.39, -21, 48, 36.0, 5.87 },
-    { 21, 28, 43.39, -21, 48, 25.9, 4.51 },
-    { 19, 26, 19.20, -21, 46, 36.1, 5.59 },
-    {  3, 19, 31.01, -21, 45, 28.1, 3.69 },
-    { 11, 12, 34.61, -21, 44, 57.1, 6.40 },
-    { 19,  4, 40.99, -21, 44, 30.1, 3.77 },
-    {  0, 48,  1.10, -21, 43, 21.0, 5.57 },
-    { 18, 14, 15.91, -21, 42, 47.2, 5.44 },
-    { 17, 43, 25.80, -21, 40, 59.9, 4.87 },
-    { 19, 12, 28.01, -21, 39, 29.2, 6.41 },
-    {  2, 46, 45.19, -21, 38, 22.9, 6.49 },
-    {  3, 33, 47.30, -21, 37, 58.1, 4.27 },
-    {  1, 29, 36.10, -21, 37, 45.8, 5.12 },
-    {  6, 59, 39.29, -21, 36, 11.9, 6.26 },
-    { 22, 21, 35.59, -21, 35, 53.9, 5.13 },
-    { 17,  6, 11.81, -21, 33, 52.9, 6.30 },
-    { 20, 46, 10.01, -21, 30, 51.1, 5.93 },
-    { 17, 30, 41.70, -21, 29, 14.0,      },
-    { 16, 32,  8.21, -21, 27, 59.0, 4.45 },
-    { 18,  7, 11.40, -21, 26, 38.0, 6.28 },
-    { 17, 24, 42.00, -21, 26, 30.1, 5.85 },
-    { 14, 57, 28.01, -21, 24, 56.2, 5.74 },
-    { 18, 37, 54.41, -21, 23, 52.1, 5.94 },
-    {  5, 27, 36.50, -21, 22, 32.2, 6.07 },
-    { 23, 31, 42.10, -21, 22,  9.8, 6.29 },
-    { 18, 54,   .10, -21, 21, 34.9, 5.69 },
-    { 14, 47, 13.70, -21, 19, 28.9, 6.06 },
-    {  8, 16, 54.19, -21, 19, 13.1, 6.60 },
-    { 19, 30, 54.00, -21, 18, 43.9, 6.13 },
-    { 16, 16, 58.80, -21, 18, 14.0, 6.61 },
-    {  4, 45,  4.20, -21, 17,  1.0, 5.72 },
-    {  1, 38, 51.79, -21, 16, 31.1, 5.58 },
-    {  5, 20, 26.90, -21, 14, 21.8, 4.71 },
-    { 22, 11,  2.40, -21, 13, 57.0, 6.09 },
-    { 21, 27, 14.81, -21, 11, 46.0, 5.78 },
-    { 21,  8, 33.60, -21, 11, 37.0, 5.30 },
-    { 21, 58, 43.80, -21, 10, 58.1, 6.12 },
-    { 14, 46, 10.90, -21, 10, 34.0, 6.40 },
-    {  7, 51, 42.89, -21, 10, 26.0, 5.63 },
-    { 23,  9, 26.81, -21, 10, 21.0, 3.66 },
-    {  8, 44, 55.20, -21, 10,  4.1, 6.11 },
-    {  9, 33, 12.50, -21,  6, 56.9, 5.01 },
-    { 17, 21,   .19, -21,  6, 46.1, 4.39 },
-    { 16, 14, 28.80, -21,  6, 27.0, 6.41 },
-    { 18, 57, 43.80, -21,  6, 24.1, 3.51 },
-    {  2,  0,   .29, -21,  4, 40.1, 4.00 },
-    { 22, 14, 18.00, -21,  4, 27.1, 5.32 },
-    { 18, 13, 45.79, -21,  3, 32.0, 3.86 },
-    { 18, 38, 53.40, -21,  3,  6.8, 5.86 },
-    {  8, 49, 44.90, -21,  2, 55.0, 6.47 },
-    {  8, 25, 19.10, -21,  2, 44.9, 6.01 },
-    { 19,  9, 45.79, -21,  1, 25.0, 2.89 },
-    { 15, 38, 16.30, -21,  0, 58.0, 5.84 },
-    {  6, 47,  1.49, -21,  0, 56.2, 6.08 },
-    {  2, 51,  2.30, -21,  0, 15.1, 4.75 },
-    { 18, 45, 18.70, -21,  0,  5.0, 6.36 },
-    {  2, 13,   .89, -21,  0,  1.1, 5.86 },
-    { 15, 57, 40.39, -20, 58, 59.2, 5.85 },
-    {  8, 28, 53.30, -20, 57,  1.1, 6.67 },
-    {  6, 18, 58.99, -20, 55, 34.0, 5.81 },
-    {  6, 33, 26.59, -20, 55, 26.0, 6.40 },
-    { 23, 33, 16.61, -20, 54, 51.8, 4.71 },
-    {  3, 48, 35.81, -20, 54, 11.2, 5.81 },
-    {  7, 11, 41.59, -20, 52, 59.2, 5.84 },
-    {  5, 51, 19.30, -20, 52, 45.1, 3.81 },
-    { 23,  2, 44.30, -20, 52, 14.2, 5.97 },
-    { 16,  7, 24.31, -20, 52,  7.0, 4.32 },
-    {  5, 31,  7.61, -20, 51, 49.0, 5.55 },
-    { 21, 24,  9.60, -20, 51,  6.8, 5.41 },
-    { 12, 14, 59.59, -20, 50, 39.1, 5.83 },
-    {  8, 27, 33.29, -20, 50, 38.0, 6.56 },
-    { 18, 35, 21.29, -20, 50, 26.9, 6.48 },
-    {  1, 59, 46.10, -20, 49, 27.8, 5.41 },
-    { 11, 31, 47.59, -20, 46, 36.1, 6.24 },
-    {  5, 28, 14.69, -20, 45, 33.8, 2.84 },
-    {  9, 29, 12.60, -20, 44, 55.0, 5.66 },
-    { 15, 30, 36.29, -20, 43, 41.9, 6.22 },
-    { 18, 15, 12.89, -20, 43, 41.9, 5.38 },
-    {  4, 18, 15.91, -20, 42, 56.2, 6.00 },
-    { 22, 34, 41.59, -20, 42, 29.9, 5.20 },
-    { 10, 16, 45.60, -20, 40, 14.2, 6.57 },
-    { 16,  6, 48.41, -20, 40,  9.1, 3.96 },
-    { 10, 55, 11.59, -20, 39, 54.0, 6.44 },
-    { 18, 57, 20.50, -20, 39, 23.0, 5.08 },
-    { 21, 15, 37.90, -20, 39,  6.1, 5.24 },
-    { 23, 26,  2.81, -20, 38, 30.8, 4.39 },
-    {  4, 20, 39.00, -20, 38, 22.9, 5.38 },
-    { 13,  3, 46.10, -20, 34, 59.2, 5.58 },
-    { 21,  9, 33.00, -20, 33, 23.0, 6.25 },
-    {  8,  7, 18.00, -20, 33, 16.9, 5.38 },
-    { 18, 25, 21.00, -20, 32, 30.1, 4.81 },
-    { 12, 35, 58.61, -20, 31, 37.9, 6.20 },
-    {  4,  5, 46.70, -20, 30, 43.9, 6.34 },
-    { 17,  4, 45.31, -20, 29, 40.9, 6.30 },
-    { 14, 34, 50.69, -20, 26, 21.1, 6.50 },
-    { 16, 53, 25.20, -20, 24, 56.2, 5.88 },
-    { 16, 40, 34.51, -20, 24, 31.0, 6.26 },
-    {  6, 55,  2.71, -20, 24, 16.9, 5.74 },
-    { 18, 15, 12.89, -20, 23, 17.2, 5.95 },
-    {  4,  4, 40.99, -20, 22, 54.1, 6.13 },
-    {  8,  8, 43.51, -20, 21, 47.2, 6.36 },
-    {  4, 11, 36.19, -20, 21, 22.0, 5.79 },
-    { 18,  0,   .10, -20, 20, 21.1, 6.21 },
-    {  0, 28, 21.10, -20, 20,  6.0, 6.43 },
-    { 18, 49, 40.10, -20, 19, 28.9, 5.24 },
-    { 11, 42,  3.50, -20, 17, 38.0, 6.22 },
-    {  6, 15,  8.40, -20, 16, 19.9, 5.91 },
-    {  6, 53, 32.90, -20, 13, 27.1, 4.83 },
-    { 16, 19,  7.70, -20, 13,  4.1, 6.29 },
-    {  0, 16, 42.50, -20, 12, 38.2, 6.47 },
-    {  7, 49, 45.19, -20, 12, 24.8, 6.56 },
-    { 15, 53, 20.11, -20, 10,  1.9, 5.03 },
-    { 15, 31, 43.39, -20,  9, 52.9, 6.22 },
-    {  7,  0,  8.11, -20,  9, 32.0, 6.31 },
-    {  4,  3, 36.79, -20,  9, 29.9, 7.01 },
-    {  4,  3, 24.70, -20,  8, 39.1, 6.46 },
-    { 10, 53, 29.50, -20,  8, 20.0, 5.24 },
-    {  6, 55, 37.39, -20,  8, 11.0, 4.68 },
-    {  5, 44, 28.39, -20,  7, 35.0, 6.34 },
-    { 23, 22, 58.20, -20,  6,  2.2, 3.97 },
-    { 21, 34, 51.00, -20,  5,  3.8, 5.69 },
-    {  8, 21, 21.19, -20,  4, 45.1, 5.58 },
-    {  0, 21, 46.30, -20,  3, 28.1, 5.12 },
-    {  5,  1, 25.61, -20,  3,  6.8, 4.91 },
-    {  0,  2, 57.60, -20,  2, 46.0, 6.25 },
-    {  2, 26, 35.21, -20,  2, 34.1, 5.88 },
-    { 16, 24,  6.19, -20,  2, 15.0, 4.50 },
-    {  2, 33, 40.20, -20,  0,  6.8, 6.21 },
-    { 14, 25, 29.81, -19, 58, 10.9, 6.61 },
-    {  6, 18, 13.70, -19, 58,   .8, 5.52 },
-    { 13, 15, 58.80, -19, 56, 35.2, 5.22 },
-    { 13, 14, 10.90, -19, 55, 50.9, 5.33 },
-    { 16, 41, 53.71, -19, 55, 27.8, 5.57 },
-    {  4, 35,   .50, -19, 55, 14.2, 6.13 },
-    { 13, 50, 34.51, -19, 53, 49.9, 6.53 },
-    { 10, 22, 12.91, -19, 52,   .8, 6.13 },
-    { 21,  4, 24.31, -19, 51, 18.0, 4.84 },
-    { 18, 11, 14.81, -19, 50, 31.9, 6.36 },
-    { 16,  5, 26.21, -19, 48, 20.2, 2.62 },
-    { 19,  9, 48.10, -19, 48, 13.0, 6.13 },
-    { 16,  5, 26.50, -19, 48,  6.8, 4.92 },
-    { 12, 33, 22.39, -19, 47, 30.8, 6.26 },
-    { 15, 12, 13.30, -19, 47, 30.1, 4.54 },
-    {  6, 23, 47.59, -19, 47,  7.1, 6.60 },
-    { 19, 46, 21.70, -19, 45, 40.0, 4.86 },
-    { 12, 41, 49.20, -19, 45, 31.0, 6.03 },
-    {  9, 11, 58.70, -19, 44, 52.1, 5.73 },
-    {  8, 38, 40.30, -19, 44, 12.8, 6.33 },
-    {  8,  4, 41.50, -19, 43, 41.2, 6.13 },
-    {  7, 36, 40.99, -19, 42,  7.9, 5.74 },
-    {  5, 25, 59.81, -19, 41, 44.2, 5.89 },
-    { 15, 41, 56.81, -19, 40, 44.0, 4.74 },
-    {  4, 40, 26.50, -19, 40, 18.1, 4.32 },
-    { 15, 32, 36.70, -19, 40, 14.2, 5.52 },
-    {  7, 40, 13.61, -19, 39, 38.9, 5.93 },
-    { 12,  0, 51.19, -19, 39, 32.0, 5.26 },
-    { 15, 13, 19.20, -19, 38, 51.0, 6.08 },
-    {  5, 53, 57.41, -19, 38, 17.9, 6.69 },
-    { 21, 43, 13.49, -19, 37, 14.9, 6.22 },
-    { 22, 47, 33.10, -19, 36, 47.9, 5.26 },
-    { 18, 46,  1.20, -19, 36, 23.0, 6.42 },
-    {  3, 41, 22.39, -19, 35,  4.9, 6.59 },
-    {  9, 35, 33.70, -19, 35,  1.0, 6.31 },
-    {  8, 31, 30.91, -19, 34, 39.0, 5.42 },
-    { 16, 57,  4.01, -19, 32, 24.0, 6.27 },
-    {  7, 50,  5.71, -19, 31, 25.0, 6.12 },
-    { 13, 21, 29.90, -19, 29, 20.0, 6.21 },
-    { 21, 37,  4.80, -19, 27, 58.0, 4.68 },
-    { 16, 11, 59.69, -19, 27, 38.2, 4.01 },
-    {  4, 28, 39.00, -19, 27, 29.9, 5.96 },
-    { 16, 11, 58.61, -19, 26, 58.9, 6.30 },
-    {  7, 33, 19.51, -19, 24, 45.0, 5.66 },
-    {  9, 32, 20.40, -19, 24,  1.1, 5.74 },
-    { 15, 55,   .31, -19, 22, 59.2, 5.94 },
-    { 17, 20, 34.20, -19, 19, 58.1, 6.52 },
-    { 15, 38, 54.50, -19, 18,  6.8, 5.38 },
-    { 19,  8, 16.70, -19, 17, 24.0, 5.54 },
-    { 18, 42, 55.20, -19, 17,  2.0, 6.35 },
-    {  7, 19,  1.99, -19, 16, 49.1, 6.09 },
-    {  6, 36, 40.99, -19, 15, 20.9, 3.95 },
-    { 19,  3,  3.79, -19, 14, 43.1, 6.05 },
-    {  8,  9,  1.61, -19, 14, 42.0, 4.40 },
-    { 19, 21, 37.10, -19, 14,  3.1, 6.26 },
-    {  8, 59, 39.89, -19, 12, 29.2, 6.18 },
-    {  6,  7, 41.59, -19,  9, 56.9, 5.31 },
-    { 10, 12, 37.80, -19,  9, 13.0, 6.44 },
-    { 21, 29, 59.59, -19,  8, 52.1, 6.57 },
-    { 18, 49, 35.50, -19,  8, 31.9, 6.75 },
-    { 18, 31, 53.30, -19,  7, 30.0, 6.68 },
-    { 20, 19, 23.59, -19,  7,  7.0, 5.28 },
-    { 19,  3,  7.01, -19,  6, 11.9, 6.37 },
-    {  1, 22, 30.50, -19,  4, 53.0, 6.35 },
-    {  0, 17, 32.59, -19,  3,  4.0, 6.45 },
-    { 19, 52, 12.00, -19,  2, 42.0, 5.92 },
-    { 20, 59, 36.10, -19,  2,  7.1, 6.25 },
-    {  6, 53, 18.79, -19,  1, 58.1, 5.64 },
-    {  7, 22, 13.51, -19,  1,   .1, 4.96 },
-    {  7, 24, 50.71, -19,  0, 43.9, 6.24 },
-    {  9, 54, 52.20, -19,  0, 33.8, 4.94 },
-    { 19, 17, 38.11, -18, 57, 11.2, 4.96 },
-    {  6, 53, 21.70, -18, 55, 59.9, 6.14 },
-    {  0, 14, 38.40, -18, 55, 58.1, 4.44 },
-    { 23, 51, 21.29, -18, 54, 32.0, 5.18 },
-    { 17,  1, 51.19, -18, 53,  8.2, 6.26 },
-    { 21, 42, 39.50, -18, 51, 59.0, 4.73 },
-    { 18, 21, 23.11, -18, 51, 36.0, 5.75 },
-    { 19, 36, 26.11, -18, 51, 10.1, 6.11 },
-    { 22, 43, 35.30, -18, 49, 49.1, 4.69 },
-    { 13, 13, 26.81, -18, 49, 36.1, 6.28 },
-    { 17, 55, 55.01, -18, 48,  7.9, 6.52 },
-    { 11, 23, 21.89, -18, 46, 48.0, 5.09 },
-    { 19,  7,  8.50, -18, 44, 16.1, 6.29 },
-    { 18, 30, 11.90, -18, 43, 44.0, 5.66 },
-    { 13, 32,  2.81, -18, 43, 44.0, 6.01 },
-    { 14, 18, 38.30, -18, 42, 58.0, 5.90 },
-    { 23, 24,  7.80, -18, 41, 15.0, 6.19 },
-    {  7, 10,  9.29, -18, 41,  7.1, 6.23 },
-    {  7, 39,  7.10, -18, 40, 45.1, 6.72 },
-    { 23, 46,   .91, -18, 40, 41.2, 5.29 },
-    {  4, 44,  7.99, -18, 40,   .1, 5.53 },
-    { 18, 15, 30.79, -18, 39, 41.0, 6.07 },
-    {  6, 36, 22.80, -18, 39, 36.0, 5.70 },
-    { 21, 51, 41.81, -18, 37, 23.2, 6.16 },
-    { 18, 18, 43.30, -18, 37,  9.8, 6.84 },
-    { 18, 48, 45.31, -18, 36,  5.0, 6.47 },
-    { 20, 29, 52.51, -18, 35, 12.1, 6.74 },
-    { 14, 17,  3.79, -18, 35,  7.1, 6.22 },
-    { 20, 29, 53.90, -18, 34, 59.9, 5.94 },
-    {  2, 45,  6.19, -18, 34, 21.0, 4.47 },
-    { 10, 35, 38.90, -18, 34,  9.1, 6.49 },
-    { 18, 59, 26.81, -18, 34,   .8, 6.37 },
-    {  3, 18, 41.21, -18, 33, 34.9, 5.71 },
-    {  5, 43, 21.60, -18, 33, 27.0, 5.73 },
-    { 16, 14, 39.10, -18, 32,  7.1, 6.32 },
-    {  5, 19, 17.50, -18, 31, 12.0, 6.36 },
-    { 22,  8, 58.99, -18, 31, 10.9, 5.81 },
-    {  5, 19, 18.29, -18, 30, 34.9, 6.54 },
-    { 11, 12, 30.41, -18, 30,   .0, 6.13 },
-    {  6, 15, 17.50, -18, 28, 36.1, 5.99 },
-    { 18, 17, 28.49, -18, 27, 47.9, 6.54 },
-    { 16, 27,  1.39, -18, 27, 23.0, 4.42 },
-    { 17, 24, 37.10, -18, 26, 44.9, 6.21 },
-    {  3, 53, 13.01, -18, 26,  3.8, 6.22 },
-    { 18, 31, 26.30, -18, 24, 10.1, 5.14 },
-    {  7, 59, 52.01, -18, 23, 57.1, 4.61 },
-    {  2, 22, 57.79, -18, 21, 15.8, 6.22 },
-    { 11, 44, 45.79, -18, 21,  2.9, 4.73 },
-    { 16,  9, 55.20, -18, 20, 26.9, 6.47 },
-    {  9,  9,  4.30, -18, 19, 43.0, 5.73 },
-    { 13, 18, 24.31, -18, 18, 41.0, 4.74 },
-    { 19, 21, 50.90, -18, 18, 29.9, 5.87 },
-    { 10, 59, 46.51, -18, 17, 56.0, 4.08 },
-    { 23, 44, 12.10, -18, 16, 36.8, 5.24 },
-    { 12, 38, 44.59, -18, 15,  1.1, 6.00 },
-    {  8, 55, 12.41, -18, 14, 29.0, 5.75 },
-    {  6, 37, 53.40, -18, 14, 15.0, 4.43 },
-    { 19, 37,  3.31, -18, 13, 52.0, 5.64 },
-    { 20, 27, 19.20, -18, 12, 42.1, 5.25 },
-    { 14, 15, 24.10, -18, 12,  2.9, 5.43 },
-    { 15, 20, 53.71, -18,  9, 31.0, 6.17 },
-    { 20, 40,  3.00, -18,  8, 19.0, 5.10 },
-    { 13, 49, 52.30, -18,  8,  3.1, 4.97 },
-    {  5, 18, 50.40, -18,  7, 48.0, 5.96 },
-    {  6,  9, 20.30, -18,  7, 34.0, 6.35 },
-    { 10,  4,  2.90, -18,  6,  6.1, 5.86 },
-    { 23, 19, 24.10, -18,  4, 31.1, 5.93 },
-    {  0, 47, 43.30, -18,  3, 41.0, 5.70 },
-    { 20, 49, 20.50, -18,  2,  8.9, 6.21 },
-    { 23, 41, 34.49, -18,  1, 37.9, 5.34 },
-    {  0, 43, 35.40, -17, 59, 12.1, 2.04 },
-    { 21, 17, 57.29, -17, 59,  7.1, 5.43 },
-    { 10, 21,  7.80, -17, 59,  6.0, 6.51 },
-    {  6, 22, 42.00, -17, 57, 20.9, 1.98 },
-    {  0, 12, 10.01, -17, 56, 17.9, 5.25 },
-    { 20, 54, 47.90, -17, 55, 23.2, 5.78 },
-    { 22,  2, 11.90, -17, 54, 13.0, 6.28 },
-    {  7, 27,  7.99, -17, 51, 51.8, 5.63 },
-    { 13, 47, 25.39, -17, 51, 36.0, 5.43 },
-    {  5, 39, 16.30, -17, 50, 57.8, 6.38 },
-    { 19, 21, 40.39, -17, 50, 49.9, 3.93 },
-    {  5, 32, 43.80, -17, 49, 19.9, 2.58 },
-    { 23, 41, 45.79, -17, 48, 59.0, 4.82 },
-    { 20, 28, 51.60, -17, 48, 49.0, 4.78 },
-    { 18, 27, 56.50, -17, 48,   .0, 6.20 },
-    {  2,  8, 45.70, -17, 46, 45.8, 6.10 },
-    { 15, 14, 33.70, -17, 46,  7.0, 6.17 },
-    {  6, 12, 46.30, -17, 45, 47.2, 6.52 },
-    { 17, 19, 53.30, -17, 45, 23.0, 6.02 },
-    { 16, 41, 34.39, -17, 44, 31.9, 4.96 },
-    { 13, 23,  1.10, -17, 44,  7.1, 5.37 },
-    { 11, 24, 52.90, -17, 41,  2.0, 4.08 },
-    {  2, 22,  4.99, -17, 39, 43.9, 5.87 },
-    { 17,  8, 14.90, -17, 36, 33.1, 5.99 },
-    {  8, 21, 54.60, -17, 35, 11.0, 5.75 },
-    {  0,  8, 33.41, -17, 34, 39.0, 6.06 },
-    { 12, 15, 48.41, -17, 32, 30.8, 2.59 },
-    {  5, 42, 14.30, -17, 31, 49.1, 6.15 },
-    {  3, 36, 17.40, -17, 28,   .8, 5.23 },
-    {  6, 28, 37.30, -17, 27, 58.0, 5.77 },
-    { 21, 18, 15.70, -17, 27, 43.9, 7.05 },
-    { 21,  7, 44.59, -17, 27, 19.1, 6.17 },
-    {  8, 25, 39.41, -17, 26, 21.8, 6.44 },
-    {  0,  7, 18.19, -17, 23, 11.0, 6.19 },
-    { 18, 17, 11.59, -17, 22, 26.0, 5.75 },
-    { 21, 15,  6.60, -17, 20, 42.0, 6.04 },
-    {  0,  3, 44.40, -17, 20, 10.0, 4.55 },
-    { 10, 46, 52.01, -17, 17, 48.1, 5.42 },
-    { 21,  5, 56.81, -17, 13, 58.1, 4.07 },
-    {  7, 49, 41.21, -17, 13, 41.9, 5.18 },
-    { 18,  1, 23.11, -17,  9, 24.8, 6.28 },
-    { 18,  7, 48.41, -17,  9, 15.1, 5.52 },
-    { 11, 56,   .91, -17,  9,  2.9, 5.18 },
-    {  5, 16, 48.10, -17,  8, 30.1, 6.56 },
-    { 10,  7,  9.50, -17,  8, 30.1, 5.60 },
-    {  6, 50, 21.89, -17,  5,  2.0, 5.79 },
-    { 23,  5, 12.79, -17,  4, 45.1, 6.14 },
-    {  6, 56,  8.21, -17,  3, 15.1, 4.37 },
-    {  5, 24, 28.39, -16, 58, 34.0, 5.65 },
-    { 22,  2, 26.59, -16, 57, 51.1, 6.37 },
-    {  4, 47, 36.31, -16, 56,  3.8, 5.51 },
-    {  1, 52, 52.10, -16, 55, 45.1, 5.80 },
-    { 10, 38, 34.99, -16, 52, 36.1, 4.91 },
-    {  6, 38, 35.40, -16, 52, 25.0, 6.03 },
-    { 15, 32, 55.20, -16, 51, 10.1, 5.50 },
-    { 21, 50, 13.10, -16, 50, 40.9, 6.38 },
-    { 10, 26,  5.40, -16, 50, 11.0, 3.81 },
-    { 21, 22, 14.81, -16, 50,  3.8, 4.28 },
-    {  6, 17, 41.71, -16, 48, 56.9, 5.14 },
-    { 16, 56,  1.80, -16, 48, 22.0, 6.37 },
-    { 22, 26, 34.39, -16, 44, 33.0, 6.35 },
-    { 22, 26, 34.20, -16, 44, 29.0, 6.57 },
-    {  4, 55,  6.79, -16, 44, 26.2, 5.70 },
-    { 15, 53, 49.51, -16, 43, 45.8, 4.15 },
-    {  5, 41, 41.50, -16, 43, 32.2, 6.21 },
-    { 15, 28, 15.41, -16, 42, 59.0, 5.64 },
-    {  6, 45,  8.90, -16, 42, 58.0,-1.46 },
-    {  8, 56, 34.10, -16, 42, 33.8, 5.96 },
-    { 12, 17,  3.29, -16, 41, 37.0, 6.05 },
-    { 21, 40,  5.50, -16, 39, 43.9, 3.68 },
-    { 12, 27, 49.39, -16, 37, 54.8, 6.35 },
-    { 11, 39, 50.40, -16, 37, 13.1, 6.19 },
-    {  6, 16,  7.70, -16, 37,  4.1, 5.92 },
-    { 16, 31,  8.30, -16, 36, 46.1, 4.28 },
-    { 15, 30, 40.39, -16, 36, 33.8, 5.82 },
-    {  4,  4,  8.71, -16, 35, 20.0, 6.39 },
-    {  9, 51, 59.59, -16, 32,  4.9, 6.08 },
-    { 16,  0, 19.61, -16, 31, 59.9, 5.47 },
-    {  0,  4, 19.70, -16, 31, 44.0, 5.78 },
-    { 20, 35, 32.21, -16, 31, 32.9, 6.19 },
-    {  0, 40, 28.61, -16, 31,   .8, 6.49 },
-    { 12, 29, 51.89, -16, 30, 56.2, 2.95 },
-    {  6,  4, 59.09, -16, 29,  3.8, 4.93 },
-    {  0, 45, 41.69, -16, 25, 27.1, 6.47 },
-    {  4, 55, 18.60, -16, 25,  4.1, 5.72 },
-    {  7, 19, 28.10, -16, 23, 42.0, 5.70 },
-    {  4,  9, 17.81, -16, 23,  8.9, 5.37 },
-    { 18, 55, 31.01, -16, 22, 36.1, 5.79 },
-    {  4, 59,  1.30, -16, 22, 32.9, 5.66 },
-    { 10, 59, 30.91, -16, 21, 14.0, 5.89 },
-    { 10, 36, 16.70, -16, 20, 39.8, 6.03 },
-    { 14,  5, 13.99, -16, 20,  8.9, 6.56 },
-    {  4, 48, 32.50, -16, 19, 45.8, 5.77 },
-    { 17, 18, 19.20, -16, 18, 42.8, 6.43 },
-    { 14, 10, 50.50, -16, 18,  6.8, 4.91 },
-    { 19, 40, 43.39, -16, 17, 35.9, 6.20 },
-    {  8, 17, 23.11, -16, 17,  6.0, 6.16 },
-    { 11, 33, 14.59, -16, 16, 50.2, 6.05 },
-    { 22, 54, 45.50, -16, 16, 18.8, 5.56 },
-    { 15,  6, 37.61, -16, 15, 24.8, 5.20 },
-    {  8,  9, 28.51, -16, 14, 56.0, 5.68 },
-    {  5, 47,  7.61, -16, 14, 16.1, 6.17 },
-    {  7,  9, 33.19, -16, 14,  4.9, 6.03 },
-    { 19,  6, 52.30, -16, 13, 44.0, 6.03 },
-    {  4, 50, 11.59, -16, 13,  1.9, 5.03 },
-    {  5, 12, 55.90, -16, 12, 20.2, 3.31 },
-    {  7, 24, 40.10, -16, 12,  4.0, 5.33 },
-    { 13, 12,  3.50, -16, 11, 55.0, 5.04 },
-    { 12, 32,  4.20, -16, 11, 46.0, 4.31 },
-    { 10, 49, 37.49, -16, 11, 37.0, 3.11 },
-    { 13, 44, 29.81, -16, 10, 45.1, 5.60 },
-    {  8, 58, 43.90, -16,  7, 58.1, 5.86 },
-    { 21, 47,  2.40, -16,  7, 37.9, 2.87 },
-    { 20, 40, 32.50, -16,  7, 27.1, 5.80 },
-    { 19, 42, 31.10, -16,  7, 26.0, 5.06 },
-    { 14, 50, 52.70, -16,  2, 30.1, 2.75 },
-    { 20, 57, 40.61, -16,  1, 54.1, 5.87 },
-    {  3, 11, 16.80, -16,  1, 31.1, 6.26 },
-    {  7, 47, 45.19, -16,  0, 51.8, 6.43 },
-    { 14, 50, 41.21, -15, 59, 49.9, 5.15 },
-    {  7, 47, 38.50, -15, 59, 26.9, 6.34 },
-    { 13, 27, 27.19, -15, 58, 25.0, 4.76 },
-    { 19, 21, 43.61, -15, 57, 18.0, 4.61 },
-    {  8, 41, 43.30, -15, 56, 35.9, 4.88 },
-    {  1, 44,  4.10, -15, 56, 15.0, 3.50 },
-    { 11, 50, 19.51, -15, 51, 50.0, 6.13 },
-    { 23, 49, 31.61, -15, 51, 40.0, 6.24 },
-    { 23, 58, 21.19, -15, 50, 51.0, 6.26 },
-    {  9, 19, 33.19, -15, 50,  3.8, 5.78 },
-    { 18, 20,  8.81, -15, 49, 54.1, 5.39 },
-    { 22, 54, 39.00, -15, 49, 14.9, 3.27 },
-    { 17, 56, 19.01, -15, 48, 45.0, 5.89 },
-    { 11,  0, 57.19, -15, 47, 34.1, 6.34 },
-    {  8, 13, 19.99, -15, 47, 17.9, 4.99 },
-    { 13, 45, 35.11, -15, 46,  3.0, 6.19 },
-    { 20, 28, 43.61, -15, 44, 30.1, 6.41 },
-    { 17, 10, 22.70, -15, 43, 28.9, 2.43 },
-    {  1, 34, 37.80, -15, 40, 34.0, 5.63 },
-    { 15, 44,  4.39, -15, 40, 22.1, 5.41 },
-    { 16, 49, 27.79, -15, 40,  3.0, 6.10 },
-    {  1, 24, 39.79, -15, 39, 37.1, 6.14 },
-    { 19,  5, 41.21, -15, 39, 37.1, 5.97 },
-    {  7,  3, 45.50, -15, 37, 59.9, 4.12 },
-    {  9, 20, 55.49, -15, 37,  4.1, 6.33 },
-    { 10,  8, 35.50, -15, 36, 42.1, 6.27 },
-    { 18, 54, 43.10, -15, 36, 11.2, 5.10 },
-    {  7, 16, 14.50, -15, 35,  8.9, 5.46 },
-    {  9, 30, 22.61, -15, 34, 37.9, 5.85 },
-    { 17, 37, 36.19, -15, 34, 16.0, 5.94 },
-    { 15, 21,  1.39, -15, 32, 53.9, 6.30 },
-    { 19, 19,   .10, -15, 32, 11.0, 6.06 },
-    { 19, 57, 57.00, -15, 29, 29.0, 5.02 },
-    { 19, 43, 33.50, -15, 28, 12.0, 5.49 },
-    {  0, 11, 15.91, -15, 28,  5.2, 4.89 },
-    { 14, 45, 57.79, -15, 27, 34.9, 6.33 },
-    { 23, 42, 27.89, -15, 26, 52.1, 5.28 },
-    { 10, 53, 32.90, -15, 26, 44.2, 6.38 },
-    {  1, 35, 58.99, -15, 24,  1.1, 5.42 },
-    { 17, 37, 35.21, -15, 23, 55.0, 3.54 },
-    { 13, 32, 51.70, -15, 21, 47.2, 5.55 },
-    {  2, 26,   .31, -15, 20, 28.0, 5.83 },
-    { 12, 55, 53.30, -15, 19, 36.8, 6.17 },
-    {  2,  2, 58.61, -15, 18, 20.9, 5.86 },
-    { 23, 43, 49.49, -15, 17,  3.8, 6.36 },
-    { 19,  1, 33.50, -15, 16, 57.0, 6.32 },
-    {  7, 40, 23.21, -15, 15, 49.0, 4.94 },
-    { 10, 47, 37.99, -15, 15, 42.8, 6.67 },
-    { 23, 34, 49.39, -15, 14, 44.9, 5.96 },
-    {  2, 32,  5.21, -15, 14, 40.9, 4.75 },
-    {  3, 40, 11.40, -15, 13, 36.1, 6.33 },
-    { 21, 15, 44.90, -15, 10, 17.0, 5.28 },
-    {  6, 48, 57.79, -15,  8, 40.9, 5.39 },
-    {  6, 23, 46.01, -15,  4, 18.1, 6.24 },
-    { 20, 31,  4.30, -15,  3, 23.0, 6.12 },
-    { 19, 26, 11.11, -15,  3, 11.2, 5.72 },
-    { 15, 43, 24.89, -15,  2, 35.9, 6.31 },
-    { 23, 22, 39.19, -15,  2, 21.1, 5.20 },
-    {  8, 32, 33.29, -15,  1, 45.8, 6.38 },
-    {  9, 15, 24.89, -15,  1, 28.9, 6.35 },
-    {  6, 18, 48.79, -15,  1, 28.9, 6.06 },
-    {  7, 29, 21.89, -14, 59, 57.1, 6.05 },
-    {  0, 36,  3.00, -14, 58, 25.0, 6.45 },
-    { 14,  4, 27.00, -14, 58, 18.1, 6.28 },
-    { 20, 39, 16.39, -14, 57, 16.9, 5.22 },
-    {  6,  6,  9.29, -14, 56,  7.1, 4.67 },
-    {  8, 25, 55.61, -14, 55, 46.9, 5.98 },
-    { 16, 48, 27.00, -14, 54, 33.8, 6.03 },
-    { 16, 19,   .41, -14, 52, 21.0, 5.94 },
-    { 16, 58, 41.59, -14, 52, 10.9, 6.59 },
-    { 18, 32, 43.30, -14, 51, 56.2, 5.50 },
-    {  0, 29, 51.89, -14, 51, 51.1, 6.14 },
-    { 18, 33, 39.00, -14, 51, 13.0, 5.76 },
-    { 16, 15, 51.50, -14, 50, 57.1, 6.09 },
-    {  9, 51, 28.70, -14, 50, 48.1, 4.12 },
-    {  7, 52, 18.91, -14, 50, 47.0, 5.69 },
-    { 15, 56, 33.41, -14, 49, 45.1, 6.13 },
-    {  5, 46, 57.29, -14, 49, 18.8, 3.55 },
-    {  4, 59, 36.50, -14, 48, 20.9, 7.71 },
-    {  6, 45, 59.30, -14, 47, 46.0, 5.32 },
-    { 15, 35, 31.61, -14, 47, 21.8, 3.91 },
-    { 20, 20, 46.61, -14, 47,  6.0, 6.10 },
-    { 20, 21,   .70, -14, 46, 53.0, 3.08 },
-    { 11, 19, 20.50, -14, 46, 43.0, 3.56 },
-    { 21, 44,  1.01, -14, 44, 57.8, 5.99 },
-    { 17, 47, 36.79, -14, 43, 32.9, 5.94 },
-    {  7, 45, 29.09, -14, 41, 26.9, 6.07 },
-    {  7, 45, 28.70, -14, 41, 10.0, 6.89 },
-    {  0,  2,  7.30, -14, 40, 34.0, 7.10 },
-    { 18, 32, 20.81, -14, 38, 39.1, 6.37 },
-    {  5, 13, 59.90, -14, 36, 24.1, 6.21 },
-    { 19, 53,  6.41, -14, 36, 11.2, 6.48 },
-    {  1, 25, 37.20, -14, 35, 56.0, 4.90 },
-    { 22, 30, 17.40, -14, 35,  8.9, 6.37 },
-    {  6,  9, 34.30, -14, 35,  3.1, 5.56 },
-    { 17, 15, 20.30, -14, 35,  2.0, 5.99 },
-    { 18, 29, 46.80, -14, 34, 54.1, 5.96 },
-    {  9, 17,  7.49, -14, 34, 25.0, 5.84 },
-    { 18, 29, 11.90, -14, 33, 56.9, 4.70 },
-    { 18, 41, 42.50, -14, 33, 51.1, 6.42 },
-    {  7, 45, 56.90, -14, 33, 50.0, 5.04 },
-    { 19, 26, 24.60, -14, 33,  4.0, 6.70 },
-    { 16, 29, 46.90, -14, 33,  2.9, 5.68 },
-    {  2, 41, 34.01, -14, 32, 57.8, 5.98 },
-    { 23, 42, 43.30, -14, 32, 42.0, 4.49 },
-    {  7, 33, 47.90, -14, 31, 26.0, 4.97 },
-    { 23,  9, 49.61, -14, 30, 38.2, 6.42 },
-    {  6,  2, 33.79, -14, 29, 49.9, 6.20 },
-    {  7, 36,  3.91, -14, 29, 34.1, 5.70 },
-    {  5, 49, 36.50, -14, 29,  1.0, 5.49 },
-    { 20, 58, 41.90, -14, 28, 58.1, 6.01 },
-    { 21, 11, 41.30, -14, 28, 19.9, 6.48 },
-    { 11, 39, 51.10, -14, 28,  7.0, 6.21 },
-    {  7, 37, 38.90, -14, 26, 28.0, 6.53 },
-    {  6, 46, 51.10, -14, 25, 32.9, 5.29 },
-    { 23, 50, 33.31, -14, 24,  6.8, 5.72 },
-    { 21, 43,  4.39, -14, 23, 58.9, 5.88 },
-    { 15, 56, 14.40, -14, 23, 57.8, 6.37 },
-    {  5,  3, 52.01, -14, 22,  9.8, 6.41 },
-    {  7, 20, 58.20, -14, 21, 36.0, 5.45 },
-    {  4, 39, 19.70, -14, 21, 33.1, 5.45 },
-    {  7, 33, 22.10, -14, 20, 17.9, 6.21 },
-    {  9, 40, 18.41, -14, 19, 55.9, 5.06 },
-    {  4, 38, 10.80, -14, 18, 14.0, 3.87 },
-    { 19, 37, 34.39, -14, 18,  6.1, 5.47 },
-    { 15, 58, 11.40, -14, 16, 45.8, 4.88 },
-    { 23, 52, 30.00, -14, 15,  4.0, 5.87 },
-    {  4, 57, 44.81, -14, 13, 53.0, 6.15 },
-    { 23, 39, 47.11, -14, 13, 18.1, 5.00 },
-    { 22, 12, 25.80, -14, 11, 38.0, 6.03 },
-    {  5, 56, 24.29, -14, 10,  4.1, 3.71 },
-    { 14, 49, 19.10, -14,  8, 56.0, 5.31 },
-    {  6, 39, 16.70, -14,  8, 44.9, 4.82 },
-    { 15, 51, 38.40, -14,  8,  1.0, 6.19 },
-    { 11,  0, 11.59, -14,  4, 59.9, 5.88 },
-    { 16,  7,  3.41, -14,  4, 14.9, 6.32 },
-    { 22, 47, 42.79, -14,  3, 23.0, 5.66 },
-    { 21, 41, 32.90, -14,  2, 51.0, 5.18 },
-    {  6, 56,  6.60, -14,  2, 37.0, 5.00 },
-    { 18, 38,  4.61, -14,  0, 16.9, 6.47 },
-    { 10, 42, 31.30, -13, 58, 30.0, 6.24 },
-    { 18,  9, 43.39, -13, 56,  3.8, 6.39 },
-    {  5, 23, 30.19, -13, 55, 37.9, 5.25 },
-    {  7, 51, 46.30, -13, 53, 53.2, 5.17 },
-    { 19, 25, 21.60, -13, 53, 48.8, 5.69 },
-    { 22,  6, 26.21, -13, 52, 10.9, 4.27 },
-    { 12, 32, 36.00, -13, 51, 33.1, 5.74 },
-    {  2, 44,  7.39, -13, 51, 31.0, 4.25 },
-    {  8, 10, 39.79, -13, 47, 57.1, 5.54 },
-    {  4, 49, 42.19, -13, 46, 10.9, 6.26 },
-    { 10, 54, 17.81, -13, 45, 29.2, 5.66 },
-    {  5, 21, 51.00, -13, 45, 22.0, 6.56 },
-    {  7, 25,  8.30, -13, 45,  6.8, 5.78 },
-    { 20, 34, 11.69, -13, 43, 16.0, 6.13 },
-    {  6, 15, 44.90, -13, 43,  5.9, 5.01 },
-    { 19, 48,  3.00, -13, 42, 11.9, 6.11 },
-    {  4, 31, 25.90, -13, 38, 42.0, 6.21 },
-    { 20,  1, 58.61, -13, 38, 12.8, 5.71 },
-    { 22, 49, 35.50, -13, 35, 33.0, 4.01 },
-    {  4, 30,  9.70, -13, 35, 31.9, 6.24 },
-    { 10, 30, 59.81, -13, 35, 17.9, 5.58 },
-    { 12, 20, 55.70, -13, 33, 56.2, 5.14 },
-    {  0, 49, 25.61, -13, 33, 41.0, 5.59 },
-    { 21, 53, 17.81, -13, 33,  6.1, 5.08 },
-    {  8, 46, 22.51, -13, 32, 52.1, 4.32 },
-    { 22, 24, 27.10, -13, 31, 45.8, 5.76 },
-    {  5, 17, 40.20, -13, 31, 10.9, 5.50 },
-    {  9, 32, 55.80, -13, 31,   .8, 5.94 },
-    { 17, 43, 48.60, -13, 30, 31.0, 6.39 },
-    {  3, 58,  1.80, -13, 30, 31.0, 2.95 },
-    { 23, 19,  6.70, -13, 27, 32.0, 5.08 },
-    { 11,  3, 36.50, -13, 26,  3.8, 6.34 },
-    { 12, 30,  4.80, -13, 23, 35.2, 6.35 },
-    { 10, 37, 33.19, -13, 23,  3.8, 4.82 },
-    { 14, 19,  6.60, -13, 22, 16.0, 4.52 },
-    {  7, 49, 28.61, -13, 21, 11.9, 6.23 },
-    {  6, 36, 46.70, -13, 19, 14.9, 5.97 },
-    { 22, 19,   .79, -13, 18, 18.0, 5.95 },
-    { 21, 17, 13.49, -13, 16, 44.0, 6.40 },
-    {  8, 52, 30.70, -13, 14,  1.0, 6.13 },
-    { 13, 34, 40.49, -13, 12, 51.8, 5.91 },
-    { 11, 38, 40.10, -13, 12,  6.8, 5.48 },
-    {  5, 19, 34.51, -13, 10, 36.1, 4.29 },
-    {  6, 30, 34.70, -13,  8, 53.2, 6.16 },
-    {  5,  6, 36.70, -13,  7, 18.8, 6.05 },
-    { 22, 59, 35.69, -13,  4, 14.9, 6.07 },
-    { 10,  5,  7.49, -13,  3, 52.9, 4.60 },
-    { 23, 37, 39.60, -13,  3, 37.1, 5.65 },
-    {  1, 26, 51.60, -13,  3, 24.1, 5.66 },
-    {  8, 22, 46.80, -13,  3, 16.9, 6.11 },
-    {  4, 29,  6.89, -13,  2, 53.9, 5.60 },
-    { 12, 41, 16.20, -13,  0, 54.0, 5.98 },
-    { 12, 41, 16.01, -13,  0, 49.0, 6.08 },
-    {  6, 37, 40.90, -12, 59,  6.0, 6.12 },
-    {  6, 24, 20.50, -12, 57, 45.0, 6.12 },
-    {  5, 13, 13.90, -12, 56, 29.0, 4.36 },
-    {  8, 11, 16.30, -12, 55, 36.8, 4.72 },
-    { 22, 30,  1.51, -12, 54, 54.0, 6.40 },
-    {  6,  0, 17.71, -12, 53, 58.9, 6.22 },
-    { 16, 59, 30.20, -12, 53, 27.0,      },
-    {  0, 45, 28.70, -12, 52, 50.9, 6.15 },
-    { 21, 24, 11.50, -12, 52, 41.2, 5.49 },
-    { 17, 41, 24.91, -12, 52, 31.1, 4.26 },
-    { 17, 20, 49.70, -12, 50, 48.8, 4.33 },
-    { 18, 59, 23.81, -12, 50, 26.2, 5.53 },
-    { 14, 47, 54.89, -12, 50, 22.9, 6.35 },
-    { 22, 16, 48.10, -12, 49, 53.0, 5.34 },
-    { 12, 33, 34.30, -12, 49, 49.1, 5.58 },
-    {  7, 51, 40.90, -12, 49,  9.8, 6.36 },
-    { 10, 10,  5.90, -12, 48, 58.0, 5.31 },
-    {  4,  4, 22.70, -12, 47, 33.0, 5.61 },
-    {  2, 52, 32.11, -12, 46,  9.8, 6.04 },
-    { 20, 20, 39.79, -12, 45, 33.1, 4.76 },
-    { 16,  7, 36.41, -12, 44, 44.2, 5.78 },
-    { 21, 49, 41.11, -12, 43, 23.2, 6.31 },
-    { 13, 26, 43.20, -12, 42, 28.1, 5.25 },
-    {  7, 46, 44.90, -12, 40, 31.1, 6.39 },
-    {  3, 29, 36.00, -12, 40, 28.9, 5.59 },
-    { 20,  5, 26.40, -12, 39, 55.1, 6.55 },
-    {  8, 18, 23.90, -12, 37, 54.8, 5.98 },
-    { 20, 12, 25.90, -12, 37,  3.0, 5.85 },
-    {  0, 10, 42.79, -12, 34, 48.0, 5.85 },
-    {  3, 59, 30.10, -12, 34, 27.1, 5.60 },
-    { 20, 50, 41.81, -12, 32, 42.0, 5.88 },
-    { 20, 18,  3.31, -12, 32, 40.9, 3.57 },
-    {  4, 59, 55.80, -12, 32, 15.0, 4.79 },
-    {  8, 26, 41.90, -12, 32,  3.8, 5.54 },
-    { 10, 19, 16.80, -12, 31, 41.2, 6.00 },
-    { 17, 27,  2.11, -12, 30, 45.0, 6.21 },
-    { 20, 17, 38.90, -12, 30, 29.9, 4.24 },
-    {  5,  7, 25.01, -12, 29, 26.2, 5.97 },
-    {  8, 40,  1.51, -12, 28, 31.1, 4.98 },
-    {  2, 47, 55.99, -12, 27, 38.2, 6.90 },
-    { 10, 38, 50.40, -12, 26, 37.0, 6.04 },
-    { 13, 45, 56.30, -12, 25, 36.1, 5.51 },
-    {  7,  6, 35.90, -12, 23, 38.0, 6.48 },
-    { 20, 11, 57.89, -12, 23, 33.0, 6.34 },
-    {  6, 31, 22.99, -12, 23, 30.1, 5.15 },
-    { 15, 23, 52.20, -12, 22,  9.8, 5.72 },
-    {  9,  9, 11.50, -12, 21, 28.1, 5.77 },
-    { 11, 27,  9.50, -12, 21, 24.1, 5.94 },
-    { 10, 10, 35.30, -12, 21, 15.1, 3.61 },
-    { 20, 16, 22.80, -12, 20, 12.8, 6.32 },
-    {  5, 19, 59.09, -12, 18, 56.2, 5.30 },
-    { 14, 36, 59.81, -12, 18, 19.1, 6.20 },
-    {  2, 25, 57.00, -12, 17, 26.2, 4.89 },
-    { 19, 13, 15.50, -12, 16, 57.0, 5.51 },
-    { 19, 35, 33.60, -12, 15, 10.1, 6.27 },
-    { 10, 36, 32.40, -12, 13, 49.1, 5.70 },
-    {  0, 22, 51.79, -12, 12, 33.8, 6.39 },
-    {  7, 47, 56.71, -12, 11, 35.2, 5.48 },
-    { 11, 51, 21.89, -12, 11, 16.1, 6.35 },
-    {  4, 38, 53.59, -12,  7, 23.2, 5.01 },
-    {  3, 46,  8.50, -12,  6,  6.1, 4.42 },
-    {  3, 55, 16.30, -12,  5, 57.1, 6.00 },
-    { 10,  9, 56.50, -12,  5, 44.9, 6.24 },
-    {  6, 54, 11.40, -12,  2, 19.0, 4.07 },
-    { 18, 23, 12.19, -12,  0, 52.9, 5.73 },
-    {  0, 43, 50.21, -12,  0, 42.1, 6.02 },
-    {  9, 19, 46.39, -11, 58, 30.0, 4.79 },
-    {  8, 42,  9.79, -11, 57, 58.0, 6.45 },
-    { 23, 47, 15.91, -11, 54, 38.9, 5.73 },
-    {  5, 27,  4.80, -11, 54,  2.9, 6.35 },
-    { 14, 54, 22.90, -11, 53, 53.9, 5.80 },
-    {  2, 39, 33.79, -11, 52, 19.9, 4.84 },
-    {  5, 12, 17.90, -11, 52,  9.1, 4.45 },
-    {  5, 11, 22.80, -11, 50, 57.1, 5.68 },
-    { 16, 13, 50.90, -11, 50, 15.0, 5.22 },
-    {  3, 41, 13.80, -11, 48, 11.2, 6.49 },
-    { 16, 54, 40.30, -11, 47, 33.0, 6.57 },
-    {  5, 37,  8.81, -11, 46, 32.2, 6.11 },
-    {  5, 54, 43.61, -11, 46, 26.0, 5.66 },
-    {  6, 21, 24.70, -11, 46, 23.9, 5.64 },
-    { 10, 37, 11.59, -11, 44, 55.0, 6.52 },
-    { 14, 23, 25.61, -11, 42, 51.1, 6.21 },
-    { 23, 17, 40.01, -11, 42, 47.2, 6.34 },
-    { 23, 41,  8.90, -11, 40, 50.2, 5.89 },
-    { 14, 24, 40.90, -11, 40, 10.9, 6.49 },
-    { 12, 54, 18.70, -11, 38, 55.0, 6.00 },
-    { 22, 53, 28.70, -11, 37,   .1, 5.80 },
-    { 12, 25, 11.71, -11, 36, 37.1, 5.95 },
-    { 20,  5,  5.40, -11, 35, 57.8, 6.34 },
-    { 20, 53,  5.59, -11, 34, 25.0, 6.38 },
-    { 21, 28, 13.90, -11, 34,  5.9, 6.61 },
-    { 22, 10, 37.49, -11, 33, 54.0, 5.46 },
-    {  7, 27, 51.70, -11, 33, 24.8, 5.79 },
-    {  6, 24, 10.30, -11, 31, 49.1, 5.22 },
-    { 23, 28,  5.21, -11, 26, 58.9, 6.37 },
-    { 14, 56, 46.10, -11, 24, 34.9, 5.46 },
-    {  0, 58, 43.90, -11, 22, 48.0, 5.61 },
-    { 16,  4, 22.10, -11, 22, 23.2, 5.07 },
-    { 16,  4, 22.10, -11, 22, 23.2, 4.77 },
-    { 21,  9, 35.69, -11, 22, 18.1, 4.51 },
-    { 21, 46, 32.11, -11, 21, 56.9, 5.58 },
-    {  8,  8, 56.90, -11, 20, 22.9, 6.32 },
-    {  1, 41, 44.71, -11, 19, 28.9, 5.75 },
-    {  9, 19, 33.70, -11, 18, 51.1, 6.62 },
-    { 11,  3, 14.90, -11, 18, 13.0, 5.50 },
-    {  7,  6, 40.70, -11, 17, 39.1, 5.39 },
-    {  3, 28,  1.01, -11, 17, 12.1, 5.73 },
-    {  0, 56,  1.51, -11, 16,   .1, 5.31 },
-    {  7, 13,  7.20, -11, 15,  5.0, 5.78 },
-    { 17, 34, 46.39, -11, 14, 30.8, 5.55 },
-    {  1, 20, 27.79, -11, 14, 20.0, 6.15 },
-    { 10, 16,  9.10, -11, 12, 11.9, 6.08 },
-    {  3, 35, 57.70, -11, 11, 37.0, 5.57 },
-    {  6,  6, 51.89, -11, 10, 25.0, 6.66 },
-    {  6, 32, 46.90, -11,  9, 59.0, 6.24 },
-    { 13, 25, 11.59, -11,  9, 41.0, 0.98 },
-    { 14, 58, 13.39, -11,  9, 18.0, 6.60 },
-    { 14, 58, 53.59, -11,  8, 39.1, 5.87 },
-    {  7, 50, 55.20, -11,  7, 43.0, 6.16 },
-    { 11,  5, 34.01, -11,  5, 20.0, 6.09 },
-    {  8, 46,  6.89, -11,  0, 23.0, 6.25 },
-    { 18, 35,  2.40, -10, 58, 37.9, 5.14 },
-    { 16, 57, 26.09, -10, 57, 47.9, 6.19 },
-    { 17, 38,  9.50, -10, 55, 35.0, 5.75 },
-    { 22, 31, 41.30, -10, 54, 20.2, 6.38 },
-    {  1, 27, 46.61, -10, 54,  6.1, 6.13 },
-    { 17, 53,  3.60, -10, 53, 58.9, 6.18 },
-    { 10,  8, 45.70, -10, 53,  4.9, 6.53 },
-    { 19, 49,  2.21, -10, 52, 14.9, 6.04 },
-    { 11, 24, 36.60, -10, 51, 33.8, 4.83 },
-    { 18, 31, 25.70, -10, 47, 44.9, 5.72 },
-    {  4, 33, 22.01, -10, 47,  8.9, 6.06 },
-    { 16, 49, 49.99, -10, 46, 59.2, 4.65 },
-    {  2, 22,  1.39, -10, 46, 40.1, 5.46 },
-    {  9, 40, 20.11, -10, 46,  9.1, 6.37 },
-    { 19, 50, 46.80, -10, 45, 49.0, 5.39 },
-    { 13,  7, 53.81, -10, 44, 25.1, 5.19 },
-    {  6, 17, 35.21, -10, 43, 31.1, 6.75 },
-    { 17, 20, 52.70, -10, 41, 46.0, 6.46 },
-    { 23, 14, 40.20, -10, 41, 19.0, 6.12 },
-    {  1, 49, 35.09, -10, 41, 11.0, 4.67 },
-    { 22, 30, 38.81, -10, 40, 41.2, 4.82 },
-    {  7,  5, 49.70, -10, 39, 40.0, 6.49 },
-    {  0, 50,  7.61, -10, 38, 39.8, 5.19 },
-    {  0, 44, 11.40, -10, 36, 33.8, 4.76 },
-    { 21, 14, 16.70, -10, 36, 19.1, 6.77 },
-    {  6,  1, 50.40, -10, 35, 53.2, 4.95 },
-    {  7, 15, 43.10, -10, 35,  2.0, 5.95 },
-    { 10, 36, 17.40, -10, 34, 59.9, 6.57 },
-    { 21, 39, 28.10, -10, 34, 36.8, 6.08 },
-    {  9, 39, 47.40, -10, 34, 13.1, 6.31 },
-    { 16, 37,  9.50, -10, 34,  1.9, 2.56 },
-    { 19, 35,  7.30, -10, 33, 37.1, 5.12 },
-    { 22, 48, 30.19, -10, 33, 20.2, 6.19 },
-    {  9, 31, 38.90, -10, 33,  7.9, 6.14 },
-    {  5, 47, 26.71, -10, 31, 59.2, 6.03 },
-    { 17,  9, 48.00, -10, 31, 23.9, 5.56 },
-    {  0,  4, 30.10, -10, 30, 33.8, 4.94 },
-    {  3, 43, 33.79, -10, 29,  8.2, 5.60 },
-    { 12,  0, 44.50, -10, 26, 46.0, 5.55 },
-    {  3, 39, 25.39, -10, 26, 13.9, 6.19 },
-    {  5, 40, 46.01, -10, 24, 33.8, 6.52 },
-    {  9, 31, 55.80, -10, 22, 14.2, 6.13 },
-    {  7,  9, 20.30, -10, 20, 49.9, 6.21 },
-    { 12, 51, 22.90, -10, 20, 17.9, 6.41 },
-    {  1, 51, 27.60, -10, 20,  6.0, 3.73 },
-    { 14,  9,   .60, -10, 20,  3.8, 6.47 },
-    { 13,  9, 45.31, -10, 19, 45.8, 5.94 },
-    {  5, 25,  1.61, -10, 19, 45.1, 5.61 },
-    {  7, 29, 22.10, -10, 19, 36.1, 5.75 },
-    { 15, 24, 11.90, -10, 19, 19.9, 4.94 },
-    {  7, 14, 28.20, -10, 19,   .1, 6.03 },
-    { 11, 48, 23.50, -10, 18, 47.9, 6.26 },
-    { 12, 15, 10.61, -10, 18, 45.0, 6.11 },
-    { 21, 53, 36.00, -10, 18, 42.1, 6.59 },
-    { 14, 12, 53.81, -10, 16, 25.0, 4.19 },
-    {  4, 59, 50.40, -10, 15, 47.9, 5.38 },
-    {  4, 14, 23.71, -10, 15, 23.0, 4.87 },
-    {  6,  5, 27.00, -10, 14, 34.1, 5.87 },
-    { 18, 23,  2.21, -10, 13,  7.0, 6.33 },
-    {  1,  8, 35.40, -10, 10, 55.9, 3.45 },
-    {  8, 19, 15.10, -10,  9, 56.9, 6.32 },
-    { 13, 32, 58.10, -10,  9, 54.0, 5.21 },
-    { 18, 46, 43.30, -10,  7, 30.0, 5.71 },
-    {  7,  3, 57.29, -10,  7, 27.1, 6.45 },
-    {  6, 46, 39.00, -10,  6, 25.9, 5.66 },
-    {  6, 30, 11.30, -10,  4, 53.0, 5.93 },
-    { 15, 34, 10.70, -10,  3, 51.8, 4.62 },
-    { 16, 12,   .00, -10,  3, 51.1, 4.94 },
-    { 20,  8, 31.30, -10,  3, 46.1, 6.18 },
-    {  2, 11, 22.20, -10,  3,  7.9, 6.01 },
-    {  1,  5, 36.79, - 9, 58, 45.1, 6.12 },
-    { 23, 50, 14.69, - 9, 58, 27.1, 5.94 },
-    {  3,  1, 56.09, - 9, 57, 41.0, 5.83 },
-    { 19, 59, 47.40, - 9, 57, 29.9, 5.88 },
-    {  7, 14, 15.50, - 9, 56, 51.0, 5.90 },
-    {  6, 23, 36.00, - 9, 52, 27.8, 6.19 },
-    {  3, 34, 37.39, - 9, 52,  7.0, 6.25 },
-    { 20, 32, 23.71, - 9, 51, 11.9, 5.65 },
-    { 10, 49, 43.49, - 9, 51, 10.1, 5.86 },
-    {  1,  6,  5.09, - 9, 50, 21.8, 5.58 },
-    {  9, 22, 50.90, - 9, 50, 20.0, 6.53 },
-    { 11, 36, 40.90, - 9, 48,  7.9, 4.70 },
-    {  1,  7, 46.20, - 9, 47,  8.2, 5.82 },
-    {  2, 58, 47.40, - 9, 46, 35.0, 6.14 },
-    { 18, 50, 58.49, - 9, 46, 27.1, 5.83 },
-    { 17, 59,  1.61, - 9, 46, 25.0, 3.34 },
-    {  3, 43, 14.90, - 9, 45, 47.9, 3.54 },
-    { 18, 17, 24.19, - 9, 45, 31.0, 6.31 },
-    {  3, 56, 37.90, - 9, 45,  2.9, 6.19 },
-    { 21, 25, 13.10, - 9, 44, 55.0, 5.70 },
-    {  8, 28, 50.90, - 9, 44, 53.9, 6.00 },
-    {  4, 35, 13.99, - 9, 44, 12.1, 6.37 },
-    { 13, 47, 13.49, - 9, 42, 33.1, 6.05 },
-    {  5, 39, 30.79, - 9, 42, 24.1, 6.50 },
-    { 20, 56, 54.00, - 9, 41, 51.0, 5.51 },
-    {  5, 47, 45.41, - 9, 40, 10.9, 2.06 },
-    { 20, 23,   .79, - 9, 39, 16.9, 6.30 },
-    { 23, 18, 57.70, - 9, 36, 38.9, 4.98 },
-    { 18, 53,  1.90, - 9, 34, 34.0, 6.34 },
-    { 10,  3, 40.99, - 9, 34, 26.0, 6.12 },
-    {  0, 14, 54.50, - 9, 34, 10.9, 5.75 },
-    {  5, 59,  4.30, - 9, 33, 29.9, 5.03 },
-    {  9, 20, 28.99, - 9, 33, 20.9, 4.80 },
-    { 16, 39, 39.10, - 9, 33, 15.8, 6.35 },
-    {  7, 41, 14.81, - 9, 33,  4.0, 3.93 },
-    { 12, 54, 21.19, - 9, 32, 20.0, 4.79 },
-    { 13,  9, 14.40, - 9, 32, 17.9, 6.32 },
-    { 20, 47, 40.61, - 9, 29, 44.9, 3.77 },
-    {  2, 15, 28.30, - 9, 27, 56.2, 6.55 },
-    {  3, 32, 55.80, - 9, 27, 29.9, 3.73 },
-    {  2, 40, 12.31, - 9, 27, 11.2, 5.78 },
-    { 12, 33, 46.80, - 9, 27,  6.8, 5.48 },
-    {  2, 52, 50.50, - 9, 26, 28.0, 6.32 },
-    {  9, 37, 51.50, - 9, 25, 27.8, 6.40 },
-    {  1, 37, 37.70, - 9, 24, 14.0, 6.24 },
-    {  6, 18, 50.59, - 9, 23, 25.1, 5.36 },
-    { 15, 17,   .41, - 9, 22, 59.2, 2.61 },
-    {  5, 59,  1.01, - 9, 22, 55.9, 6.12 },
-    { 21, 10, 46.90, - 9, 21, 14.0, 6.27 },
-    { 21, 22, 56.30, - 9, 19,  9.8, 5.99 },
-    { 14,  6, 42.79, - 9, 18, 47.9, 5.46 },
-    { 21, 46, 16.30, - 9, 16, 32.9, 6.00 },
-    { 23, 29,   .60, - 9, 15, 58.0, 6.18 },
-    {  8,  6, 27.50, - 9, 14, 42.0, 6.23 },
-    {  9, 27, 14.59, - 9, 13, 25.0, 6.54 },
-    {  7,  0, 39.29, - 9, 12, 11.2, 6.49 },
-    {  7, 50, 10.61, - 9, 10, 59.9, 5.61 },
-    { 15, 34, 26.59, - 9, 10, 59.9, 5.17 },
-    { 23, 17, 54.19, - 9, 10, 57.0, 4.39 },
-    {  6, 41, 56.40, - 9, 10,  1.9, 5.19 },
-    {  3, 16, 35.71, - 9,  9, 15.8, 6.14 },
-    { 23, 15, 53.50, - 9,  5, 16.1, 4.21 },
-    { 21, 45,   .31, - 9,  4, 57.0, 5.09 },
-    { 10, 19, 59.40, - 9,  3, 32.0, 6.32 },
-    { 18, 42, 16.39, - 9,  3,  9.0, 4.72 },
-    {  8, 41,  1.61, - 9,  3,  6.8, 6.63 },
-    {  5, 52,  7.61, - 9,  2, 29.0, 5.97 },
-    { 22, 16, 52.61, - 9,  2, 24.0, 5.79 },
-    {  6, 15, 25.99, - 9,  2,  7.1, 6.10 },
-    {  1, 33,  3.50, - 9,  0, 52.9, 6.59 },
-    {  6, 47, 37.10, - 8, 59, 53.9, 5.07 },
-    { 23, 52, 50.50, - 8, 59, 48.1, 5.75 },
-    { 13,  8, 32.50, - 8, 59,  3.8, 5.55 },
-    { 20, 52, 39.19, - 8, 58, 59.9, 4.73 },
-    {  7, 22,  1.99, - 8, 58, 45.1, 6.43 },
-    {  4, 34, 11.71, - 8, 58, 13.1, 5.26 },
-    { 18, 23, 39.50, - 8, 56,  3.1, 4.68 },
-    {  1, 10, 12.00, - 8, 54, 22.0, 6.40 },
-    {  2, 56, 25.70, - 8, 53, 53.2, 3.89 },
-    { 10, 50, 18.10, - 8, 53, 52.1, 5.79 },
-    {  7, 32,  5.81, - 8, 52, 50.9, 5.90 },
-    {  7, 21, 16.90, - 8, 52, 41.9, 6.55 },
-    {  4,  5, 56.50, - 8, 51, 22.0, 6.26 },
-    { 20, 11, 10.10, - 8, 50, 31.9, 6.49 },
-    {  0,  8, 17.40, - 8, 49, 26.0, 5.99 },
-    {  0, 19, 25.70, - 8, 49, 26.0, 3.56 },
-    {  4, 10, 47.69, - 8, 49, 10.9, 5.70 },
-    {  3, 15, 49.99, - 8, 49, 10.9, 4.80 },
-    {  8, 28, 19.70, - 8, 48, 58.0, 6.43 },
-    {  4, 43, 35.09, - 8, 47, 46.0, 6.70 },
-    { 15, 38, 40.01, - 8, 47, 39.8, 6.50 },
-    {  4, 43, 34.61, - 8, 47, 37.0, 6.82 },
-    { 15, 38, 40.10, - 8, 47, 28.0, 6.48 },
-    {  9,  9, 35.50, - 8, 47, 16.1, 5.46 },
-    {  5,  9,  8.81, - 8, 45, 15.1, 4.27 },
-    {  9, 16, 41.30, - 8, 44, 40.9, 5.47 },
-    {  0, 54, 17.59, - 8, 44, 26.9, 6.16 },
-    { 13, 41, 36.79, - 8, 42, 11.2, 5.01 },
-    {  5,  8, 20.21, - 8, 39, 54.0, 5.78 },
-    {  9, 27, 35.21, - 8, 39, 31.0, 1.98 },
-    {  9,  8, 42.19, - 8, 35, 21.8, 5.60 },
-    {  6, 19,  7.90, - 8, 35, 11.0, 6.22 },
-    { 19, 54,  8.21, - 8, 34, 27.1, 5.79 },
-    { 16, 12,  7.30, - 8, 32, 51.0, 5.43 },
-    {  2,  0, 26.90, - 8, 31, 25.0, 5.51 },
-    { 15,  0, 58.39, - 8, 31,  8.0, 4.92 },
-    {  9, 33,  2.09, - 8, 30, 19.1, 6.12 },
-    {  4, 44,  5.30, - 8, 30, 13.0, 5.90 },
-    { 10, 10, 55.80, - 8, 25,  5.9, 5.65 },
-    {  5, 23, 18.50, - 8, 24, 56.9, 5.90 },
-    { 16,  0, 47.59, - 8, 24, 41.0, 5.55 },
-    { 10, 10,  7.49, - 8, 24, 29.9, 5.91 },
-    {  7,  0, 23.69, - 8, 24, 24.8, 5.96 },
-    { 16, 27, 48.10, - 8, 22, 18.1, 4.63 },
-    { 16, 15, 37.30, - 8, 22,  9.8, 5.50 },
-    { 18,  6,  7.39, - 8, 19, 26.0, 5.85 },
-    { 22, 43,  3.50, - 8, 18, 42.1, 6.45 },
-    {  7, 36, 16.61, - 8, 18, 41.0, 6.27 },
-    { 18, 43, 31.30, - 8, 16, 31.1, 4.90 },
-    { 18, 35, 12.41, - 8, 14, 39.1, 3.85 },
-    { 19, 54, 38.11, - 8, 14, 13.9, 6.49 },
-    {  4, 34, 11.59, - 8, 13, 53.0, 5.11 },
-    { 19, 54, 37.61, - 8, 13, 37.9, 5.71 },
-    { 17, 28,  2.30, - 8, 12, 29.9, 6.37 },
-    {  5, 14, 32.30, - 8, 12,  6.1, 0.12 },
-    { 19, 22, 20.69, - 8, 12,  4.0, 6.31 },
-    {  7, 40, 35.50, - 8, 11,  8.9, 6.01 },
-    {  1, 24,  1.39, - 8, 10, 59.9, 3.60 },
-    { 18,  3,  4.90, - 8, 10, 50.2, 5.24 },
-    { 18,  3,  4.99, - 8, 10, 49.1, 5.94 },
-    {  6, 57,   .10, - 8, 10, 44.0, 6.34 },
-    {  6, 31, 50.09, - 8,  9, 29.2, 5.43 },
-    {  5, 13, 33.29, - 8,  8, 52.1, 6.37 },
-    { 16, 28, 48.91, - 8,  7, 44.0, 6.48 },
-    { 17, 37, 50.69, - 8,  7,  8.0, 4.62 },
-    {  9, 52, 30.41, - 8,  6, 18.0, 5.05 },
-    { 10, 17, 37.80, - 8,  4,  8.0, 5.24 },
-    { 13, 54, 58.20, - 8,  3, 32.0, 6.19 },
-    {  0, 18, 41.81, - 8,  3, 10.1, 6.46 },
-    {  6, 50, 42.29, - 8,  2, 28.0, 6.29 },
-    {  1, 24,  2.50, - 8,  0, 27.0, 6.21 },
-    { 12, 39, 14.81, - 7, 59, 44.2, 4.66 },
-    {  8, 35, 28.20, - 7, 58, 55.9, 5.72 },
-    {  8, 55, 29.59, - 7, 58, 16.0, 6.67 },
-    {  8, 55, 29.50, - 7, 58, 13.1, 6.91 },
-    { 19, 12, 40.70, - 7, 56, 21.8, 5.34 },
-    {  1, 14, 24.00, - 7, 55, 23.2, 5.13 },
-    { 18, 50, 19.99, - 7, 54, 27.0, 6.80 },
-    { 22, 38, 22.20, - 7, 53, 52.1, 6.23 },
-    {  6, 25, 58.80, - 7, 53, 39.1, 6.40 },
-    {  2, 34, 42.70, - 7, 51, 33.8, 5.75 },
-    { 21, 37, 45.10, - 7, 51, 15.1, 4.69 },
-    {  2, 36,   .00, - 7, 49, 54.1, 5.53 },
-    { 11, 32, 47.50, - 7, 49, 39.0, 5.95 },
-    {  6, 19, 42.79, - 7, 49, 23.2, 5.27 },
-    { 22, 20, 11.90, - 7, 49, 16.0, 5.37 },
-    {  5, 23, 56.81, - 7, 48, 29.2, 4.14 },
-    {  3, 23, 17.81, - 7, 47, 39.1, 6.20 },
-    { 18, 40,   .50, - 7, 47, 26.2, 5.84 },
-    { 22, 16, 49.99, - 7, 46, 59.9, 4.16 },
-    {  0, 14, 27.60, - 7, 46, 50.2, 5.12 },
-    {  8, 11, 33.00, - 7, 46, 21.0, 5.36 },
-    { 23, 16, 50.90, - 7, 43, 36.1, 5.06 },
-    { 23,  5,  9.79, - 7, 41, 37.0, 5.43 },
-    {  3,  2, 42.31, - 7, 41,  7.1, 5.32 },
-    { 12,  2, 51.60, - 7, 41,  1.0, 6.22 },
-    {  3,  1, 10.01, - 7, 39, 46.1, 5.75 },
-    {  4, 15, 16.30, - 7, 39, 10.1, 4.43 },
-    { 10, 30, 58.70, - 7, 38, 15.0, 6.20 },
-    {  3,  4, 16.39, - 7, 36,  2.9, 5.26 },
-    { 16, 27, 43.49, - 7, 35, 53.2, 5.23 },
-    {  4, 20, 42.79, - 7, 35, 33.0, 5.85 },
-    { 22, 52, 36.89, - 7, 34, 46.9, 3.74 },
-    {  7, 29, 25.70, - 7, 33,  4.0, 5.86 },
-    {  8, 22, 54.00, - 7, 32, 35.9, 5.96 },
-    { 14, 18,   .60, - 7, 32, 33.0, 6.47 },
-    {  5, 51, 22.01, - 7, 31,  5.2, 5.35 },
-    { 16, 30, 29.90, - 7, 30, 54.0, 6.50 },
-    {  6, 26, 44.90, - 7, 30, 41.0, 6.27 },
-    { 20,  4,  1.20, - 7, 28, 10.9, 6.72 },
-    { 23, 35, 32.11, - 7, 27, 51.8, 6.39 },
-    { 19, 35, 29.81, - 7, 27, 37.1, 6.34 },
-    {  5, 30, 20.71, - 7, 26,  4.9, 6.33 },
-    { 19, 23,  4.61, - 7, 24,  1.1, 6.32 },
-    {  3, 38, 29.21, - 7, 23, 30.1, 5.85 },
-    {  0, 55, 42.41, - 7, 20, 49.9, 5.85 },
-    { 10, 11, 17.81, - 7, 19,   .1, 6.25 },
-    {  5, 31, 55.80, - 7, 18,  5.0, 4.62 },
-    {  8, 43, 40.39, - 7, 14,  1.0, 4.62 },
-    {  5, 38, 53.11, - 7, 12, 47.2, 4.80 },
-    { 22, 54, 34.10, - 7, 12, 16.9, 6.19 },
-    { 13, 33,   .70, - 7, 11, 42.0, 6.68 },
-    { 22, 23, 32.11, - 7, 11, 39.8, 5.93 },
-    {  9, 33, 20.11, - 7, 11, 24.0, 6.24 },
-    {  8, 51, 34.51, - 7, 10, 37.9, 5.54 },
-    {  5,  1, 26.30, - 7, 10, 26.0, 4.81 },
-    { 11, 16, 58.20, - 7,  8,  4.9, 6.14 },
-    {  9, 12, 25.99, - 7,  6, 34.9, 6.11 },
-    { 17, 43, 46.99, - 7,  4, 45.8, 6.30 },
-    { 18, 24, 42.10, - 7,  4, 31.1, 6.31 },
-    { 18, 42, 36.10, - 7,  4, 23.9, 6.15 },
-    { 23,  1, 23.59, - 7,  3, 40.0, 6.21 },
-    { 10, 25, 44.30, - 7,  3, 34.9, 5.57 },
-    { 19, 29, 21.50, - 7,  2, 38.0, 6.61 },
-    {  6, 28, 49.51, - 7,  2,  3.8, 5.40 },
-    {  6, 28, 49.51, - 7,  2,  3.8, 5.60 },
-    {  6, 28, 49.01, - 7,  1, 58.1, 4.60 },
-    { 19, 36, 53.50, - 7,  1, 39.0, 4.95 },
-    {  1, 33, 42.89, - 7,  1, 31.1, 5.76 },
-    { 22, 43, 14.30, - 6, 57, 46.1, 6.41 },
-    {  4, 10, 22.51, - 6, 55, 26.0, 5.44 },
-    {  1, 24, 20.59, - 6, 54, 52.9, 5.91 },
-    { 14, 28, 41.71, - 6, 54,  2.2, 5.42 },
-    { 20, 53, 58.39, - 6, 53, 22.9, 6.44 },
-    {  5, 17, 36.41, - 6, 50, 39.8, 3.60 },
-    {  4, 34, 14.21, - 6, 50, 16.1, 6.09 },
-    {  4, 11, 51.91, - 6, 50, 15.0, 4.04 },
-    { 18, 43, 51.41, - 6, 49,  7.0, 6.31 },
-    {  3, 29, 39.10, - 6, 48, 18.0, 5.99 },
-    {  5, 42, 53.81, - 6, 47, 46.0, 6.02 },
-    {  7, 46,  2.21, - 6, 46, 21.0, 5.49 },
-    {  6, 11,  1.30, - 6, 45, 15.1, 6.15 },
-    {  4, 33, 54.79, - 6, 44, 20.0, 5.72 },
-    { 19, 55, 19.61, - 6, 44,  3.1, 6.51 },
-    {  6,  4, 13.51, - 6, 42, 33.1, 5.21 },
-    {  5, 31, 20.90, - 6, 42, 29.9, 6.22 },
-    {  7, 17, 31.70, - 6, 40, 48.0, 6.29 },
-    { 11, 43, 55.10, - 6, 40, 37.9, 6.07 },
-    {  8, 38, 20.30, - 6, 39, 45.0, 6.51 },
-    { 14, 16, 21.50, - 6, 37, 18.8, 6.44 },
-    { 23,  2, 32.59, - 6, 34, 27.1, 6.15 },
-    {  5, 38, 37.80, - 6, 34, 26.0, 5.96 },
-    {  8, 48,  4.90, - 6, 33, 31.0, 6.09 },
-    { 22, 31, 18.41, - 6, 33, 18.0, 6.14 },
-    {  6, 11, 51.79, - 6, 33,  1.1, 5.05 },
-    { 16, 38,  1.61, - 6, 32, 17.2, 6.09 },
-    { 22,  3, 16.39, - 6, 31, 21.0, 5.54 },
-    {  3,  2,  9.29, - 6, 29, 40.9, 6.19 },
-    {  4, 17, 19.20, - 6, 28, 18.8, 5.94 },
-    { 13, 30, 25.70, - 6, 28, 13.1, 6.09 },
-    {  2, 16, 58.99, - 6, 25, 19.9, 5.51 },
-    {  8, 27, 17.21, - 6, 24, 34.9, 6.59 },
-    { 23, 48, 32.50, - 6, 22, 50.2, 6.07 },
-    { 20, 20, 26.11, - 6, 21, 42.1, 6.63 },
-    {  9, 16, 41.71, - 6, 21, 11.2, 5.24 },
-    {  8,  2, 25.99, - 6, 20, 13.9, 6.33 },
-    { 12, 47, 33.41, - 6, 18,  6.8, 6.26 },
-    { 16,  5, 44.50, - 6, 17, 30.1, 6.53 },
-    { 23, 31,  1.10, - 6, 17, 17.9, 6.39 },
-    {  6, 14, 51.31, - 6, 16, 28.9, 3.98 },
-    { 13, 31, 57.91, - 6, 15, 20.9, 4.69 },
-    {  4, 20, 38.69, - 6, 14, 44.2, 6.27 },
-    { 17, 16, 42.79, - 6, 14, 42.0, 6.09 },
-    {  9, 51, 21.60, - 6, 10, 54.1, 6.42 },
-    {  8, 22, 30.19, - 6, 10, 45.1, 6.15 },
-    { 16, 54, 35.69, - 6,  9, 14.0, 5.25 },
-    { 17, 52, 38.81, - 6,  8, 37.0, 6.21 },
-    { 16,  5, 59.81, - 6,  8, 21.8, 6.41 },
-    { 15, 46, 45.41, - 6,  7, 13.1, 6.24 },
-    { 14, 27, 24.41, - 6,  7, 13.1, 6.17 },
-    {  3,  6, 33.50, - 6,  5, 19.0, 5.27 },
-    {  9, 27, 46.80, - 6,  4, 16.0, 5.38 },
-    {  5, 36, 35.71, - 6,  3, 54.0, 5.72 },
-    {  5, 12, 48.19, - 6,  3, 25.9, 5.91 },
-    { 23, 14, 19.39, - 6,  2, 56.0, 4.22 },
-    {  0,  1, 57.60, - 6,  0, 51.1, 4.41 },
-    {  5, 35,   .91, - 6,  0, 33.1, 5.67 },
-    {  5, 35,  2.71, - 6,  0,  6.8, 4.78 },
-    { 14, 16,   .91, - 6,  0,  2.2, 4.08 },
-    {  7, 22, 25.39, - 5, 58, 58.1, 5.82 },
-    { 14, 14, 21.29, - 5, 56, 51.0, 6.36 },
-    {  5, 37, 27.41, - 5, 56, 17.9, 6.05 },
-    { 17, 29, 47.40, - 5, 55, 10.9, 6.37 },
-    {  3, 16,   .89, - 5, 55,  7.0, 6.17 },
-    { 21, 47, 38.11, - 5, 55,  1.9, 6.17 },
-    { 17, 19, 59.50, - 5, 55,  1.9, 6.32 },
-    {  9, 34, 32.69, - 5, 54, 54.0, 5.56 },
-    { 18, 49, 40.99, - 5, 54, 46.1, 5.99 },
-    { 18, 33, 22.90, - 5, 54, 41.0, 6.36 },
-    {  5, 35, 25.99, - 5, 54, 36.0, 2.77 },
-    { 23, 20, 40.90, - 5, 54, 29.2, 6.17 },
-    {  6, 32, 23.11, - 5, 52,  8.0, 5.60 },
-    {  6, 54,  8.50, - 5, 51,  9.0, 6.41 },
-    { 18, 57,  3.70, - 5, 50, 46.0, 4.83 },
-    { 12, 36, 47.40, - 5, 49, 54.8, 5.87 },
-    { 15, 21,  7.61, - 5, 49, 28.9, 5.54 },
-    { 21,  4,  4.61, - 5, 49, 23.9, 7.31 },
-    { 21,  4,  4.70, - 5, 49, 23.2, 5.89 },
-    {  7, 25, 51.00, - 5, 46, 30.0, 5.97 },
-    {  5,  0, 49.01, - 5, 45, 11.9, 6.22 },
-    { 17, 33, 29.90, - 5, 44, 40.9, 5.62 },
-    { 19,  1, 40.80, - 5, 44, 20.0, 4.02 },
-    {  1, 45, 59.30, - 5, 43, 59.9, 5.34 },
-    { 18, 30, 14.30, - 5, 43, 27.1, 6.28 },
-    {  7,  1, 56.40, - 5, 43, 19.9, 5.20 },
-    {  6,  9, 36.19, - 5, 42, 40.0, 6.17 },
-    {  0,  5, 20.11, - 5, 42, 27.0, 4.61 },
-    { 18, 47, 28.99, - 5, 42, 18.0, 5.20 },
-    { 15, 34, 20.81, - 5, 41, 42.0, 6.51 },
-    { 19,  4, 24.19, - 5, 41,  6.0, 6.90 },
-    {  4, 48, 36.31, - 5, 40, 26.0, 5.78 },
-    { 14, 43,  3.60, - 5, 39, 29.9, 3.88 },
-    {  5, 36, 15.00, - 5, 38, 53.2, 6.54 },
-    { 20, 51, 25.70, - 5, 37, 35.0, 5.99 },
-    {  3, 39,  1.10, - 5, 37, 34.0, 5.96 },
-    { 21, 31, 33.50, - 5, 34, 16.0, 2.91 },
-    { 13,  9, 57.00, - 5, 32, 20.0, 4.38 },
-    {  5, 26,  2.40, - 5, 31,  5.9, 6.23 },
-    { 20, 52,  8.71, - 5, 30, 24.8, 5.55 },
-    { 15, 14, 50.69, - 5, 30, 10.1, 6.28 },
-    { 13, 43, 54.31, - 5, 29, 56.0, 6.51 },
-    {  3, 58, 52.30, - 5, 28, 12.0, 5.83 },
-    {  4, 52, 53.69, - 5, 27, 10.1, 4.39 },
-    {  8, 54, 17.90, - 5, 26,  3.8, 6.00 },
-    {  7, 52, 47.90, - 5, 25, 41.2, 5.76 },
-    { 21, 58, 13.30, - 5, 25, 28.9, 6.33 },
-    {  5, 35, 22.90, - 5, 24, 58.0, 5.08 },
-    { 19, 20, 32.90, - 5, 24, 56.9, 5.01 },
-    { 13, 35, 31.30, - 5, 23, 46.0, 5.73 },
-    {  5, 35, 16.49, - 5, 23, 22.9, 5.13 },
-    {  5, 35, 17.30, - 5, 23, 16.1, 6.70 },
-    { 22, 17,  6.50, - 5, 23, 13.9, 5.75 },
-    {  5, 35, 15.91, - 5, 23, 13.9, 6.73 },
-    {  5, 35, 16.10, - 5, 23,  7.1, 7.96 },
-    { 14,  4, 14.59, - 5, 22, 53.0, 6.39 },
-    {  7,  0, 18.00, - 5, 22,   .8, 6.30 },
-    {  5, 20, 26.40, - 5, 22,   .1, 6.39 },
-    {  3, 52, 41.59, - 5, 21, 41.0, 5.48 },
-    { 18,  2, 46.30, - 5, 21, 31.0, 6.76 },
-    { 11, 51,  2.21, - 5, 19, 59.9, 5.64 },
-    {  8, 20, 17.11, - 5, 19, 45.1, 6.13 },
-    {  7,  4,  5.21, - 5, 19, 25.0, 5.62 },
-    {  6, 52, 22.90, - 5, 18, 58.0, 6.30 },
-    {  0, 10, 18.79, - 5, 14, 55.0, 5.84 },
-    {  7, 30, 51.10, - 5, 13, 35.0, 6.24 },
-    {  6, 36, 35.30, - 5, 12, 40.0, 5.52 },
-    {  3, 40, 38.30, - 5, 12, 38.2, 5.53 },
-    {  4, 56, 24.19, - 5, 10, 17.0, 5.51 },
-    { 13, 24, 33.19, - 5,  9, 50.0, 5.75 },
-    { 23, 19, 24.00, - 5,  7, 27.8, 5.55 },
-    {  9, 25, 24.00, - 5,  7,  3.0, 5.59 },
-    { 10, 19, 32.21, - 5,  6, 20.9, 6.37 },
-    { 17, 26, 37.90, - 5,  5, 12.1, 4.54 },
-    {  5,  7, 51.00, - 5,  5, 11.0, 2.79 },
-    {  3, 30, 37.10, - 5,  4, 31.1, 4.73 },
-    { 12, 31, 38.71, - 5,  3,  9.0, 6.19 },
-    { 20, 47, 44.21, - 5,  1, 40.1, 4.42 },
-    { 14, 58, 52.80, - 4, 59, 21.1, 6.09 },
-    { 22, 55, 10.99, - 4, 59, 16.1, 5.72 },
-    {  8, 37, 27.10, - 4, 56,  1.0, 6.19 },
-    { 13, 23, 18.91, - 4, 55, 27.8, 5.89 },
-    {  6, 15, 29.69, - 4, 54, 55.1, 5.99 },
-    { 19, 25,  1.61, - 4, 53,  3.1, 6.52 },
-    { 19,  6, 14.90, - 4, 52, 57.0, 3.44 },
-    {  5, 35, 39.50, - 4, 51, 20.9, 5.26 },
-    {  5, 35, 23.21, - 4, 50, 17.9, 4.59 },
-    { 22, 24,  6.89, - 4, 50, 12.8, 5.78 },
-    {  1,  3,  2.59, - 4, 50, 12.1, 5.43 },
-    { 17, 59, 36.70, - 4, 49, 17.0, 5.87 },
-    {  5, 37, 53.40, - 4, 48, 49.0, 6.19 },
-    { 22, 57, 17.21, - 4, 48, 36.0, 6.31 },
-    { 23,  3, 57.29, - 4, 47, 43.1, 6.68 },
-    {  5, 55, 35.40, - 4, 47, 17.9, 6.28 },
-    {  1, 43, 54.79, - 4, 45, 56.2, 6.19 },
-    {  6, 27, 57.60, - 4, 45, 43.9, 5.06 },
-    { 18,  6, 15.19, - 4, 45,  5.0, 5.77 },
-    { 18, 47, 10.51, - 4, 44, 52.1, 4.22 },
-    { 21,  0, 33.79, - 4, 43, 49.1, 6.21 },
-    { 22, 12, 43.80, - 4, 43, 14.9, 6.39 },
-    {  8, 24, 36.41, - 4, 43,   .8, 6.01 },
-    { 23,  1, 31.70, - 4, 42, 41.0, 5.94 },
-    { 16, 18, 19.30, - 4, 41, 33.0, 3.24 },
-    {  6, 23, 22.70, - 4, 41, 13.9, 6.67 },
-    {  6, 11, 43.70, - 4, 39, 56.2, 6.18 },
-    {  5,  6, 45.70, - 4, 39, 18.0, 5.12 },
-    { 19, 37, 47.30, - 4, 38, 51.0, 5.46 },
-    {  0, 45, 24.10, - 4, 37, 45.1, 6.15 },
-    {  5, 55, 30.31, - 4, 36, 59.0, 5.87 },
-    { 12, 27, 51.60, - 4, 36, 55.1, 6.22 },
-    {  6, 26, 34.51, - 4, 35, 49.9, 6.15 },
-    {  6, 14, 36.70, - 4, 34,  5.9, 5.83 },
-    { 21, 21,  4.30, - 4, 33, 36.0, 5.87 },
-    {  7, 26,  3.50, - 4, 32, 15.0, 6.76 },
-    { 23, 29, 32.11, - 4, 31, 58.1, 6.25 },
-    { 21, 18, 11.11, - 4, 31,  9.8, 5.82 },
-    {  5, 35, 21.79, - 4, 29, 35.9, 6.56 },
-    {  5,  8, 43.61, - 4, 27, 22.0, 5.12 },
-    {  5, 35, 22.51, - 4, 25, 31.1, 6.24 },
-    { 21, 58, 55.01, - 4, 22, 23.2, 6.22 },
-    {  5, 35, 31.10, - 4, 21, 52.9, 6.38 },
-    {  0, 40, 42.41, - 4, 21,  6.8, 5.91 },
-    { 14, 57, 10.99, - 4, 20, 47.0, 4.49 },
-    {  2, 19, 40.80, - 4, 20, 44.2, 6.50 },
-    { 21, 54, 10.39, - 4, 16, 34.0, 5.71 },
-    {  5, 46,  2.81, - 4, 16,  5.9, 6.34 },
-    { 22, 10, 33.79, - 4, 16,  1.9, 6.01 },
-    {  9, 29, 32.40, - 4, 14, 49.9, 6.26 },
-    {  9, 51, 13.99, - 4, 14, 35.9, 6.01 },
-    {  7,  2, 54.79, - 4, 14, 21.1, 4.99 },
-    {  7, 10, 13.70, - 4, 14, 13.9, 4.92 },
-    { 22, 37, 45.41, - 4, 13, 41.2, 5.03 },
-    { 12, 53, 38.11, - 4, 13, 26.0, 6.44 },
-    { 17,  1,  3.60, - 4, 13, 21.0, 4.82 },
-    { 16, 12, 56.50, - 4, 13, 14.9, 6.25 },
-    {  5,  2, 45.50, - 4, 12, 34.9, 5.85 },
-    {  6,  6, 38.69, - 4, 11, 38.0, 5.38 },
-    {  7, 37, 16.70, - 4,  6, 40.0, 5.13 },
-    {  2,  3, 40.51, - 4,  6, 13.0, 5.62 },
-    {  5, 48, 34.90, - 4,  5, 40.9, 5.97 },
-    { 23, 31, 31.51, - 4,  5, 13.9, 6.49 },
-    { 17, 56, 47.71, - 4,  4, 54.8, 5.47 },
-    { 20,  6, 12.19, - 4,  4, 41.9, 6.47 },
-    { 10, 23, 26.50, - 4,  4, 27.1, 5.97 },
-    {  5, 54, 34.70, - 4,  3, 50.0, 6.57 },
-    { 19,  4, 57.60, - 4,  1, 53.0, 5.42 },
-    { 10, 49, 17.30, - 4,  1, 27.1, 6.61 },
-    { 18, 13, 10.01, - 4,  0, 42.1, 6.59 },
-    {  8, 26, 27.19, - 3, 59, 15.0, 5.59 },
-    { 21, 35, 17.59, - 3, 58, 59.2, 5.77 },
-    {  0, 30,  2.40, - 3, 57, 25.9, 5.72 },
-    { 12, 18,  9.10, - 3, 57, 15.8, 6.99 },
-    { 16, 16, 55.30, - 3, 57, 11.9, 6.18 },
-    { 12, 18,  9.60, - 3, 56, 55.0, 6.54 },
-    {  8, 25, 39.60, - 3, 54, 23.0, 3.90 },
-    {  7, 14, 10.99, - 3, 54,  5.0, 5.75 },
-    { 22, 10, 21.10, - 3, 53, 39.1, 6.27 },
-    {  6, 25, 47.11, - 3, 53, 21.1, 6.35 },
-    { 17,  8, 54.50, - 3, 52, 58.1, 6.36 },
-    { 15, 48, 56.81, - 3, 49,  7.0, 5.53 },
-    { 12, 59, 39.50, - 3, 48, 42.8, 5.79 },
-    {  3, 11, 18.79, - 3, 48, 42.1, 6.05 },
-    {  8, 24, 34.99, - 3, 45,  4.0, 5.61 },
-    {  4, 23, 40.80, - 3, 44, 44.2, 5.17 },
-    { 10, 28, 43.99, - 3, 44, 33.0, 6.05 },
-    {  6, 13, 54.29, - 3, 44, 29.0, 5.83 },
-    {  2, 56, 37.39, - 3, 42, 43.9, 5.17 },
-    { 19,  2, 54.50, - 3, 41, 56.0, 5.42 },
-    { 16, 14, 20.69, - 3, 41, 39.8, 2.74 },
-    {  1, 42, 43.49, - 3, 41, 25.1, 4.99 },
-    { 18,  0, 28.99, - 3, 41, 25.1, 4.62 },
-    {  7, 59, 44.09, - 3, 40, 46.9, 4.93 },
-    { 13,  3, 54.41, - 3, 39, 47.9, 6.59 },
-    { 11, 16, 39.70, - 3, 39,  6.1, 4.47 },
-    { 18, 15, 58.01, - 3, 37,  3.0, 6.36 },
-    {  4, 36,  1.61, - 3, 36, 42.8, 6.33 },
-    {  0, 35, 14.90, - 3, 35, 34.1, 5.20 },
-    { 18, 24,  3.50, - 3, 34, 59.9, 6.38 },
-    {  5, 39, 31.20, - 3, 33, 52.9, 6.00 },
-    { 20, 56, 18.31, - 3, 33, 41.0, 6.57 },
-    { 21, 25, 16.99, - 3, 33, 24.1, 5.49 },
-    { 23, 58, 40.39, - 3, 33, 22.0, 4.86 },
-    { 22, 40, 48.00, - 3, 33, 15.1, 6.31 },
-    { 12, 53, 11.21, - 3, 33, 11.2, 6.11 },
-    { 13, 59, 49.30, - 3, 32, 58.9, 6.40 },
-    { 23, 15, 34.30, - 3, 29, 47.0, 5.55 },
-    { 16,  9, 50.50, - 3, 28,   .8, 5.37 },
-    {  5, 29, 23.59, - 3, 26, 47.0, 5.79 },
-    {  8, 49, 21.70, - 3, 26, 35.2, 5.31 },
-    { 15, 49, 37.20, - 3, 25, 49.1, 3.53 },
-    { 21, 24, 51.70, - 3, 23, 53.9, 6.36 },
-    {  2, 37, 41.81, - 3, 23, 46.0, 5.65 },
-    {  3, 39, 38.30, - 3, 23, 35.2, 6.23 },
-    { 13,  0, 35.90, - 3, 22,  7.0, 5.99 },
-    { 20, 28, 24.91, - 3, 21, 28.1, 6.13 },
-    {  4, 36, 19.10, - 3, 21,  9.0, 3.93 },
-    { 18, 51, 22.10, - 3, 19,  4.1, 6.10 },
-    {  5, 28, 56.71, - 3, 18, 27.0, 6.39 },
-    { 21, 54, 35.90, - 3, 18,  4.0, 6.20 },
-    {  4, 45, 30.10, - 3, 15, 16.9, 4.02 },
-    {  5, 35, 35.81, - 3, 15, 10.1, 6.40 },
-    {  1, 20, 34.49, - 3, 14, 48.8, 6.23 },
-    {  2, 41, 48.29, - 3, 12, 47.9, 6.05 },
-    {  4, 32, 37.39, - 3, 12, 33.1, 5.81 },
-    { 14, 16, 30.10, - 3, 11, 47.0, 6.15 },
-    { 18, 38, 23.71, - 3, 11, 37.0, 6.49 },
-    { 23, 52, 55.61, - 3,  9, 20.2, 5.93 },
-    { 12,  5, 59.81, - 3,  7, 54.1, 6.37 },
-    { 19, 53, 18.70, - 3,  6, 51.8, 5.65 },
-    { 10, 51,  5.40, - 3,  5, 33.0, 5.95 },
-    { 15, 51, 15.60, - 3,  5, 26.2, 5.11 },
-    {  6,  0,  3.41, - 3,  4, 27.1, 4.53 },
-    {  5,  4, 54.50, - 3,  2, 22.9, 6.05 },
-    { 15,  2, 44.90, - 3,  1, 53.0, 6.61 },
-    {  0,  1, 49.39, - 3,  1, 39.0, 5.10 },
-    { 18, 16, 53.11, - 3,  0, 25.9, 6.00 },
-    { 11, 30, 18.91, - 3,  0, 13.0, 4.77 },
-    {  8,  8, 35.59, - 2, 59,  2.0, 4.34 },
-    {  7, 22, 18.50, - 2, 58, 44.0, 6.23 },
-    {  2, 19, 20.71, - 2, 58, 39.0, 3.04 },
-    {  3, 54, 17.50, - 2, 57, 16.9, 4.79 },
-    {  4, 46, 24.10, - 2, 57, 15.8, 6.33 },
-    {  3, 54, 17.40, - 2, 57, 10.1, 6.14 },
-    {  6, 19, 59.59, - 2, 56, 39.8, 4.90 },
-    { 22, 31, 18.41, - 2, 54, 40.0, 6.16 },
-    { 18, 21, 18.60, - 2, 53, 56.0, 3.26 },
-    {  5, 41, 40.30, - 2, 53, 46.0, 6.42 },
-    { 20, 29, 39.00, - 2, 53,  8.2, 4.91 },
-    { 19, 45, 52.20, - 2, 52, 59.9, 6.48 },
-    {  8,  0, 44.09, - 2, 52, 54.1, 6.51 },
-    {  3,  0, 51.00, - 2, 52, 43.0, 6.11 },
-    {  1, 24, 48.70, - 2, 50, 55.0, 6.15 },
-    {  5, 40, 37.30, - 2, 49, 30.0, 6.22 },
-    {  6, 54, 58.80, - 2, 48, 13.0, 6.04 },
-    { 20, 25, 42.50, - 2, 48,  1.1, 6.11 },
-    { 19, 30, 39.79, - 2, 47, 20.0, 5.03 },
-    {  2, 58, 42.00, - 2, 46, 57.0, 5.23 },
-    {  2, 24, 58.39, - 2, 46, 48.0, 6.33 },
-    {  9, 29,  8.90, - 2, 46,  8.0, 4.60 },
-    { 23, 47, 56.50, - 2, 45, 42.1, 5.49 },
-    { 15,  1, 19.80, - 2, 45, 18.0, 5.52 },
-    { 10, 29, 28.70, - 2, 44, 21.1, 5.21 },
-    { 16, 50, 22.30, - 2, 39, 14.0, 6.32 },
-    {  8, 45, 20.81, - 2, 36,  2.9, 6.41 },
-    {  5, 38, 44.81, - 2, 36,   .0, 3.81 },
-    {  5, 38, 47.11, - 2, 35, 39.1, 6.65 },
-    { 20, 36, 43.61, - 2, 33,   .0, 4.89 },
-    {  0,  7, 44.11, - 2, 32, 56.0, 6.43 },
-    {  6, 38, 20.50, - 2, 32, 37.0, 6.14 },
-    {  8, 28, 29.21, - 2, 31,  1.9, 6.39 },
-    {  6, 12, 44.40, - 2, 30, 15.8, 6.62 },
-    {  1, 16, 36.31, - 2, 30,  1.1, 5.41 },
-    {  5, 11, 19.20, - 2, 29, 26.9, 5.90 },
-    { 20, 47,  3.60, - 2, 29, 12.1, 6.27 },
-    { 11,  1, 49.70, - 2, 29,  4.9, 4.74 },
-    {  4, 37, 36.10, - 2, 28, 23.9, 5.23 },
-    {  2, 59, 41.21, - 2, 27, 54.0, 5.56 },
-    { 19, 51, 11.11, - 2, 27, 38.9, 6.13 },
-    {  0,  8, 12.10, - 2, 26, 52.1, 6.07 },
-    { 11, 38, 24.10, - 2, 26, 10.0, 6.22 },
-    { 15, 20, 47.09, - 2, 24, 47.9, 6.35 },
-    { 20, 39, 13.20, - 2, 24, 46.1, 6.22 },
-    {  5, 24, 28.61, - 2, 23, 48.8, 3.36 },
-    { 22, 58, 15.50, - 2, 23, 43.1, 6.16 },
-    {  2, 12, 47.50, - 2, 23, 37.0, 5.54 },
-    { 17, 22, 51.29, - 2, 23, 17.9, 6.29 },
-    { 16, 36, 21.50, - 2, 19, 28.9, 5.75 },
-    { 14, 51,  1.01, - 2, 17, 57.1, 4.94 },
-    {  6, 49, 16.39, - 2, 16, 18.8, 5.74 },
-    { 14, 19, 32.50, - 2, 15, 56.2, 5.14 },
-    { 10, 53, 24.89, - 2, 15, 19.1, 6.12 },
-    {  5, 10, 58.01, - 2, 15, 14.0, 6.25 },
-    {  1, 11, 43.49, - 2, 15,  4.0, 5.94 },
-    { 14, 28, 12.10, - 2, 13, 41.2, 4.81 },
-    {  0, 24, 29.71, - 2, 13,  9.1, 6.07 },
-    {  4, 58, 10.80, - 2, 12, 45.0, 6.35 },
-    {  9, 29, 24.50, - 2, 12, 19.1, 6.14 },
-    { 22,  3, 18.89, - 2,  9, 19.1, 4.69 },
-    { 17, 40, 11.81, - 2,  9,  9.0, 6.19 },
-    {  8, 34,  1.61, - 2,  9,  6.1, 5.81 },
-    { 10, 53, 43.70, - 2,  7, 45.1, 5.45 },
-    { 16, 22, 38.90, - 2,  4, 46.9, 6.23 },
-    {  5,  0, 39.79, - 2,  3, 56.2, 6.32 },
-    {  8, 46,  2.50, - 2,  2, 56.0, 5.70 },
-    { 18, 29, 40.99, - 1, 59,  7.1, 5.39 },
-    { 10, 48, 40.61, - 1, 57, 32.0, 5.93 },
-    {  5, 40, 45.60, - 1, 56, 34.1, 4.21 },
-    {  5, 40, 45.50, - 1, 56, 34.1, 2.05 },
-    {  7, 29, 18.70, - 1, 54, 19.1, 5.59 },
-    {  8, 47, 15.00, - 1, 53, 49.9, 5.29 },
-    {  2, 11, 35.81, - 1, 49, 31.1, 5.93 },
-    { 15, 46,  5.59, - 1, 48, 15.8, 5.40 },
-    { 18, 56, 22.70, - 1, 48,   .0, 6.22 },
-    { 12,  1,  1.80, - 1, 46,  5.2, 6.31 },
-    {  6, 54, 42.10, - 1, 45, 23.0, 6.21 },
-    { 10, 41, 24.19, - 1, 44, 30.1, 6.26 },
-    {  5, 33,  7.20, - 1, 43,  5.9, 6.46 },
-    { 11, 27, 53.71, - 1, 42,   .0, 6.25 },
-    { 17,  6, 52.90, - 1, 39, 23.0, 6.38 },
-    { 17, 25, 57.89, - 1, 39,  6.1, 6.44 },
-    {  5, 43,  9.29, - 1, 36, 47.2, 6.31 },
-    { 16, 54, 10.61, - 1, 36, 43.9, 6.25 },
-    { 21, 16, 39.60, - 1, 36, 28.1, 6.48 },
-    {  8, 21, 20.21, - 1, 36,  7.9, 6.50 },
-    { 22, 16, 33.60, - 1, 35, 47.0, 6.15 },
-    {  5, 32, 41.30, - 1, 35, 30.8, 5.35 },
-    { 18, 24, 57.00, - 1, 34, 45.8, 6.15 },
-    { 12, 43, 38.11, - 1, 34, 36.8, 5.93 },
-    { 22, 34,  2.90, - 1, 34, 27.1, 5.89 },
-    {  4,  1, 31.99, - 1, 32, 58.9, 5.28 },
-    { 19,  5, 18.60, - 1, 30, 46.1, 6.53 },
-    {  6, 26, 39.60, - 1, 30, 25.9, 5.87 },
-    { 13, 54, 42.10, - 1, 30, 11.2, 5.15 },
-    {  5, 34,  4.01, - 1, 28, 14.2, 5.93 },
-    {  9, 26, 22.30, - 1, 27, 50.0, 6.01 },
-    { 12, 41, 39.60, - 1, 26, 57.8, 3.68 },
-    { 12, 41, 39.60, - 1, 26, 57.8, 3.65 },
-    {  5, 59, 37.70, - 1, 26, 39.8, 6.63 },
-    { 14, 45, 11.71, - 1, 25,  4.1, 6.07 },
-    {  5, 19, 35.21, - 1, 24, 43.9, 6.34 },
-    { 22, 58, 23.71, - 1, 24, 37.1, 6.37 },
-    {  5, 15, 18.41, - 1, 24, 33.1, 6.15 },
-    {  8,  1, 13.30, - 1, 23, 33.0, 4.68 },
-    { 13, 16, 25.49, - 1, 23, 26.2, 6.68 },
-    { 22, 21, 39.41, - 1, 23, 13.9, 3.84 },
-    { 20, 55,  8.11, - 1, 22, 23.9, 6.55 },
-    { 13, 29, 14.90, - 1, 21, 51.8, 6.43 },
-    {  7,  1, 52.90, - 1, 20, 44.2, 6.17 },
-    {  6, 48, 19.01, - 1, 19,  9.1, 5.75 },
-    { 19, 36, 43.30, - 1, 17, 11.0, 4.36 },
-    {  9, 29,  2.21, - 1, 15, 24.8, 6.27 },
-    { 23, 34,  9.00, - 1, 14, 51.0, 5.87 },
-    { 17, 51, 59.50, - 1, 14, 12.1, 6.35 },
-    {  6, 33, 37.90, - 1, 13, 13.1, 5.10 },
-    {  5, 36, 12.79, - 1, 12,  6.8, 1.70 },
-    {  3, 12, 46.39, - 1, 11, 46.0, 5.06 },
-    { 13, 26, 11.40, - 1, 11, 33.0, 5.97 },
-    { 15, 32, 57.91, - 1, 11, 11.0, 5.51 },
-    {  9, 31, 58.90, - 1, 11,  6.0, 4.57 },
-    {  3, 44, 30.50, - 1,  9, 47.2, 5.25 },
-    {  5, 33, 31.39, - 1,  9, 22.0, 5.34 },
-    {  4, 13, 38.21, - 1,  8, 58.9, 6.44 },
-    {  0, 53,   .50, - 1,  8, 39.1, 4.77 },
-    {  9, 39, 51.41, - 1,  8, 34.1, 3.91 },
-    {  5, 40, 50.59, - 1,  7, 44.0, 4.95 },
-    {  6, 54, 24.60, - 1,  7, 36.8, 5.45 },
-    {  3, 39, 59.50, - 1,  7, 14.2, 6.12 },
-    { 18, 38, 19.10, - 1,  6, 47.9, 6.66 },
-    { 20, 38, 20.30, - 1,  6, 19.1, 4.32 },
-    {  5, 29, 43.99, - 1,  5, 31.9, 4.71 },
-    { 23, 31, 57.60, - 1,  5,  8.9, 6.38 },
-    { 17,  8, 13.61, - 1,  4, 45.8, 6.06 },
-    { 20, 19, 43.30, - 1,  4, 43.0, 6.06 },
-    {  4, 57, 17.21, - 1,  4,  1.9, 6.23 },
-    { 17, 30, 23.81, - 1,  3, 45.0, 5.31 },
-    {  4, 39, 47.21, - 1,  3, 10.1, 6.10 },
-    {  5, 34,  3.91, - 1,  2,  8.2, 6.22 },
-    {  2, 32,  9.41, - 1,  2,  6.0, 5.35 },
-    { 15, 23, 43.70, - 1,  1, 21.0, 6.12 },
-    { 20, 13, 13.90, - 1,  0, 33.8, 5.47 },
-    { 18, 31, 57.00, - 1,  0, 11.2, 5.94 },
-    { 16, 41, 11.50, - 1,  0,  2.2, 6.24 },
-    {  5, 58, 11.71, - 0, 59, 39.1, 6.22 },
-    {  1, 14, 49.20, - 0, 58, 26.0, 5.70 },
-    { 18, 46, 28.49, - 0, 57, 42.1, 5.90 },
-    {  6, 25, 16.39, - 0, 56, 46.0, 5.87 },
-    {  3, 18, 22.39, - 0, 55, 49.1, 5.38 },
-    { 21,  2, 59.59, - 0, 55, 28.9, 6.50 },
-    {  8, 20, 13.10, - 0, 54, 33.8, 6.18 },
-    { 22,  4, 47.40, - 0, 54, 24.1, 5.30 },
-    { 19, 20, 35.69, - 0, 53, 31.9, 5.49 },
-    { 17,  5, 32.30, - 0, 53, 30.8, 5.64 },
-    {  5, 24, 28.90, - 0, 53, 29.0, 5.08 },
-    {  2, 22, 12.41, - 0, 53,  6.0, 5.42 },
-    {  5, 23, 51.41, - 0, 52,  1.9, 6.11 },
-    { 14, 48, 54.10, - 0, 50, 52.1, 6.14 },
-    { 14, 13, 40.80, - 0, 50, 44.2, 5.91 },
-    { 11, 36, 56.90, - 0, 49, 26.0, 4.30 },
-    { 20, 11, 18.31, - 0, 49, 17.0, 3.23 },
-    { 12, 18, 40.30, - 0, 47, 13.9, 5.90 },
-    { 11,  3, 14.59, - 0, 45,  9.0, 6.14 },
-    { 20,  4, 23.21, - 0, 42, 33.8, 5.68 },
-    {  2, 41, 13.90, - 0, 41, 44.9, 5.71 },
-    { 20,  8,  1.80, - 0, 40, 41.9, 5.99 },
-    { 13, 17, 29.90, - 0, 40, 36.1, 6.37 },
-    { 12, 19, 54.41, - 0, 40,   .8, 3.89 },
-    { 10, 30, 17.50, - 0, 38, 12.8, 5.09 },
-    { 19, 40, 43.30, - 0, 37, 16.0, 5.67 },
-    { 13, 34, 41.59, - 0, 35, 44.9, 3.37 },
-    {  8,  5, 49.61, - 0, 34, 25.0, 6.41 },
-    {  5, 10,  3.19, - 0, 33, 55.1, 6.10 },
-    { 15, 36, 33.70, - 0, 33, 42.1, 6.51 },
-    {  5, 25, 31.20, - 0, 32, 39.1, 6.57 },
-    {  6, 50, 49.90, - 0, 32, 26.9, 5.77 },
-    {  6, 15, 34.30, - 0, 30, 43.9, 5.65 },
-    {  1, 19, 48.31, - 0, 30, 32.0, 5.87 },
-    {  0, 35, 32.81, - 0, 30, 20.2, 5.93 },
-    {  0,  5,  3.79, - 0, 30, 11.2, 6.29 },
-    {  7, 11, 51.89, - 0, 29, 34.1, 4.15 },
-    {  9,  1, 58.01, - 0, 28, 58.1, 5.67 },
-    { 15, 18, 26.21, - 0, 27, 41.0, 5.89 },
-    {  1, 22, 34.80, - 0, 26, 58.9, 6.49 },
-    { 18,  6,  7.39, - 0, 26, 48.1, 6.34 },
-    { 17, 16, 36.70, - 0, 26, 43.1, 4.73 },
-    { 19,  9, 51.60, - 0, 25, 41.2, 6.34 },
-    {  5, 21, 31.80, - 0, 24, 59.0, 5.68 },
-    {  1, 26, 27.31, - 0, 23, 55.0, 6.41 },
-    { 21, 37, 33.79, - 0, 23, 25.1, 6.25 },
-    {  5, 21, 45.70, - 0, 22, 57.0, 4.73 },
-    { 10,  7, 56.30, - 0, 22, 18.1, 4.49 },
-    {  2,  3, 48.19, - 0, 20, 25.1, 5.93 },
-    { 22,  5, 46.99, - 0, 19, 10.9, 2.96 },
-    { 11, 49,  1.20, - 0, 19,  7.0, 6.15 },
-    { 18, 37, 36.00, - 0, 18, 33.8, 5.75 },
-    {  7, 11, 23.59, - 0, 18,  6.8, 5.45 },
-    {  5, 32,   .41, - 0, 17, 57.1, 2.23 },
-    {  3, 44, 56.50, - 0, 17, 48.1, 5.55 },
-    {  5, 32,   .50, - 0, 17,  3.8, 6.85 },
-    {  6, 27, 15.60, - 0, 16, 34.0, 5.55 },
-    {  4,  2, 36.70, - 0, 16,  8.0, 5.38 },
-    { 14, 51,   .10, - 0, 15, 25.9, 6.18 },
-    { 19, 22, 21.50, - 0, 15,  9.0, 5.83 },
-    { 22, 18,  4.30, - 0, 14, 16.1, 6.39 },
-    { 10, 52, 36.10, - 0, 12,  5.0, 6.31 },
-    { 14, 57, 33.29, - 0, 10,  3.0, 5.53 },
-    {  7, 15, 19.30, - 0,  9, 41.0, 6.41 },
-    {  5, 23, 42.29, - 0,  9, 34.9, 5.70 },
-    { 15,  1, 48.91, - 0,  8, 26.2, 5.71 },
-    { 22, 35, 21.41, - 0,  7,  3.0, 4.02 },
-    {  4, 21, 27.10, - 0,  5, 53.2, 5.86 },
-    { 11, 13, 45.60, - 0,  4, 10.9, 5.42 },
-    {  0, 26, 37.39, - 0,  2, 58.9, 6.19 },
-    {  4, 31, 52.70, - 0,  2, 38.0, 4.91 },
-    { 22, 28, 49.70, - 0,  1, 13.1, 4.59 },
-    { 22, 28, 50.09, - 0,  1, 12.0, 4.42 },
-    { 11,  3, 36.60, - 0,  0,  2.9, 5.95 },
-    {  2,  6, 29.30, + 0,  2,  6.0, 6.28 },
-    { 17, 57,  4.30, + 0,  3, 59.0, 5.97 },
-    {  9, 52, 12.00, + 0,  4, 32.2, 6.35 },
-    { 21, 14, 37.01, + 0,  5, 31.9, 6.38 },
-    { 20, 37, 18.31, + 0,  5, 48.8, 6.22 },
-    { 23, 54, 46.61, + 0,  6, 33.1, 5.61 },
-    {  2,  3, 11.69, + 0,  7, 41.9, 5.43 },
-    { 11, 23, 18.00, + 0,  7, 54.1, 6.05 },
-    {  7, 22,  3.50, + 0, 10, 37.9, 5.99 },
-    { 23,  0, 37.90, + 0, 11,  8.9, 6.21 },
-    {  7, 43,  5.40, + 0, 11, 21.8, 6.19 },
-    { 18, 27, 12.50, + 0, 11, 46.0, 5.21 },
-    {  3, 48, 38.90, + 0, 13, 40.1, 5.91 },
-    { 19, 29, 18.00, + 0, 14, 46.0, 6.25 },
-    {  2, 30, 45.19, + 0, 15, 19.1, 6.00 },
-    { 19, 54, 44.81, + 0, 16, 25.0, 5.61 },
-    { 23, 23, 31.90, + 0, 17, 29.0, 6.31 },
-    {  6, 27, 13.80, + 0, 17, 57.1, 5.20 },
-    {  2, 39, 28.99, + 0, 19, 43.0, 4.07 },
-    { 17, 28, 49.70, + 0, 19, 50.2, 5.44 },
-    {  5, 41,  5.59, + 0, 20, 16.1, 5.93 },
-    { 19, 26, 31.10, + 0, 20, 19.0, 4.66 },
-    { 19, 18, 50.90, + 0, 20, 21.1, 6.41 },
-    { 17, 12, 54.41, + 0, 21,  6.8, 6.65 },
-    { 15, 15, 49.10, + 0, 22, 19.9, 5.63 },
-    { 14, 19, 40.90, + 0, 23,  3.1, 6.19 },
-    {  2, 21, 56.59, + 0, 23, 44.9, 5.28 },
-    {  3, 36, 52.39, + 0, 24,  6.1, 4.28 },
-    { 20, 57, 10.61, + 0, 27, 49.0, 6.05 },
-    {  4, 54, 50.71, + 0, 28,  3.0, 5.99 },
-    { 20, 39, 24.91, + 0, 29, 11.0, 5.16 },
-    {  6, 41,  5.40, + 0, 29, 43.1, 5.79 },
-    {  5, 11, 41.40, + 0, 30, 52.9, 6.67 },
-    {  5, 25, 46.99, + 0, 31, 14.9, 6.16 },
-    { 11, 59,  3.41, + 0, 31, 50.2, 6.17 },
-    { 21, 25, 51.50, + 0, 32,  3.8, 6.46 },
-    { 11, 53, 50.30, + 0, 33,  6.8, 6.30 },
-    {  5, 58, 49.61, + 0, 33, 11.2, 5.22 },
-    {  5, 13, 47.21, + 0, 33, 37.1, 6.32 },
-    {  3, 36, 47.30, + 0, 35, 16.1, 5.71 },
-    { 22,  1,  4.99, + 0, 36, 18.0, 5.58 },
-    { 18,  0, 15.50, + 0, 37, 45.8, 6.37 },
-    { 19,  7,  9.10, + 0, 38, 30.1, 6.56 },
-    { 16, 28, 34.01, + 0, 39, 54.0, 5.39 },
-    { 17, 56, 18.41, + 0, 40, 13.1, 5.82 },
-    { 17,  5, 16.90, + 0, 42,  9.0, 6.01 },
-    { 15, 21,  1.99, + 0, 42, 55.1, 5.35 },
-    { 14, 45, 30.19, + 0, 43,  1.9, 5.69 },
-    {  5,  1, 50.30, + 0, 43, 19.9, 5.92 },
-    { 10, 55, 42.41, + 0, 44, 12.8, 5.91 },
-    { 14, 29, 50.50, + 0, 49, 44.0, 5.94 },
-    { 18, 49, 37.10, + 0, 50,  8.9, 6.25 },
-    {  6, 26, 58.70, + 0, 50, 26.9, 6.71 },
-    { 20, 12, 35.21, + 0, 52,  3.0, 6.27 },
-    {  6, 35, 15.79, + 0, 53, 24.0, 5.80 },
-    { 15, 45, 39.70, + 0, 53, 29.0, 6.33 },
-    { 22, 59, 27.41, + 0, 57, 46.1, 5.43 },
-    {  5, 54, 44.09, + 0, 58,  5.9, 6.00 },
-    {  4, 37, 13.70, + 0, 59, 53.9, 5.31 },
-    {  6, 49,  3.70, + 1,  0,  6.8, 6.15 },
-    { 19, 52, 28.39, + 1,  0, 20.2, 3.90 },
-    { 18, 17,  4.80, + 1,  0, 20.9, 6.63 },
-    { 16, 45, 29.69, + 1,  1, 13.1, 6.03 },
-    { 10, 52, 13.70, + 1,  1, 31.1, 6.38 },
-    { 16, 22,  4.39, + 1,  1, 45.1, 4.82 },
-    {  5, 11, 45.31, + 1,  2, 12.8, 5.89 },
-    { 13, 56, 27.91, + 1,  3,  2.2, 5.91 },
-    { 22, 54, 59.50, + 1,  3, 52.9, 6.11 },
-    { 20, 24, 37.49, + 1,  4,  7.0, 6.15 },
-    { 23, 49, 27.50, + 1,  4, 34.0, 5.77 },
-    {  6, 16, 21.19, + 1,  4, 49.1, 6.63 },
-    { 19, 18, 32.50, + 1,  5,  7.1, 5.10 },
-    { 21, 26, 28.10, + 1,  6, 11.9, 6.13 },
-    { 23, 27, 14.81, + 1,  7, 21.0, 6.25 },
-    {  7, 57, 16.20, + 1,  7, 36.8, 6.35 },
-    {  5, 46, 34.99, + 1, 10,  5.2, 5.95 },
-    {  6, 15, 54.00, + 1, 10,  9.1, 6.37 },
-    {  5,  5, 23.69, + 1, 10, 39.0, 6.17 },
-    { 16, 41, 42.50, + 1, 10, 52.0, 5.74 },
-    { 17, 16, 31.70, + 1, 12, 38.2, 5.88 },
-    { 16, 51, 24.89, + 1, 12, 58.0, 5.51 },
-    {  5, 57, 54.19, + 1, 13, 27.8, 6.22 },
-    { 14, 23, 15.31, + 1, 14, 30.1, 6.27 },
-    { 23, 26, 55.99, + 1, 15, 20.2, 4.94 },
-    { 21, 42, 10.10, + 1, 17,  7.1, 5.67 },
-    {  5, 28,  1.61, + 1, 17, 53.9, 6.41 },
-    { 17, 52, 35.40, + 1, 18, 18.0, 5.95 },
-    { 18,  1, 45.19, + 1, 18, 19.1, 4.45 },
-    { 23,  5, 17.59, + 1, 18, 24.8, 6.39 },
-    { 14, 11, 31.20, + 1, 21, 43.9, 6.43 },
-    {  1,  3, 49.01, + 1, 22,   .1, 6.04 },
-    { 22, 25, 16.61, + 1, 22, 39.0, 4.66 },
-    { 19, 59, 22.70, + 1, 22, 40.1, 6.17 },
-    {  4, 28, 32.11, + 1, 22, 50.9, 5.55 },
-    {  5, 33, 57.60, + 1, 24, 28.1, 6.59 },
-    { 11, 24,  2.30, + 1, 24, 28.1, 5.39 },
-    {  9,  6, 59.90, + 1, 27, 46.1, 6.17 },
-    {  5, 42, 28.61, + 1, 28, 28.9, 4.91 },
-    {  7,  4, 20.21, + 1, 29, 17.9, 6.57 },
-    {  6, 25, 18.41, + 1, 30,  4.0, 6.66 },
-    { 21,  3,  3.00, + 1, 31, 54.8, 6.25 },
-    {  8, 58,  8.21, + 1, 32, 30.1, 6.59 },
-    { 14,  1, 38.81, + 1, 32, 39.8, 4.26 },
-    {  4, 53, 55.80, + 1, 34,  9.8, 6.61 },
-    {  5,  2,   .00, + 1, 36, 32.0, 6.24 },
-    {  6, 38, 38.11, + 1, 36, 49.0, 6.21 },
-    { 11, 18, 55.01, + 1, 39,  2.2, 5.91 },
-    { 15, 35,  4.61, + 1, 40,  8.0, 6.56 },
-    {  0, 17, 47.71, + 1, 41, 20.0, 6.17 },
-    {  6,  2, 17.11, + 1, 41, 39.8, 6.59 },
-    {  4, 58, 32.90, + 1, 42, 51.1, 4.47 },
-    {  1, 22, 37.01, + 1, 43, 35.0, 6.20 },
-    {  2, 18,  1.39, + 1, 45, 28.1, 5.58 },
-    { 11, 50, 41.71, + 1, 45, 52.9, 3.61 },
-    { 15, 19, 18.79, + 1, 45, 55.1, 5.06 },
-    {  7, 51, 42.00, + 1, 46,   .8, 5.14 },
-    { 23, 42,  2.81, + 1, 46, 48.0, 4.50 },
-    {  9, 46, 23.59, + 1, 47,  8.2, 5.65 },
-    {  5, 29, 54.79, + 1, 47, 21.1, 5.78 },
-    { 19,  3, 32.21, + 1, 49,  8.0, 5.83 },
-    {  5, 58, 24.41, + 1, 50, 12.8, 5.90 },
-    { 15, 28, 38.21, + 1, 50, 31.9, 5.17 },
-    {  5, 24, 44.81, + 1, 50, 47.0, 4.95 },
-    {  1, 55, 53.81, + 1, 50, 58.9, 6.01 },
-    { 12, 38, 22.39, + 1, 51, 16.9, 5.71 },
-    {  5, 52, 26.40, + 1, 51, 18.0, 4.78 },
-    {  4, 28,  3.60, + 1, 51, 31.0, 6.15 },
-    {  3,  4, 38.09, + 1, 51, 49.0, 6.05 },
-    {  9, 32, 41.40, + 1, 51, 51.1, 6.11 },
-    { 14, 46, 14.90, + 1, 53, 34.1, 3.72 },
-    { 12,  9, 41.30, + 1, 53, 52.1, 5.95 },
-    {  6, 28, 16.80, + 1, 54, 43.9, 6.48 },
-    {  7, 32,  5.90, + 1, 54, 51.8, 5.25 },
-    { 18,  4, 37.30, + 1, 55,  9.1, 6.14 },
-    {  0, 25, 24.19, + 1, 56, 22.9, 5.77 },
-    {  5, 16, 41.09, + 1, 56, 49.9, 6.42 },
-    { 19, 29,  1.01, + 1, 57,  1.1, 5.80 },
-    { 11,  6, 54.19, + 1, 57, 20.2, 5.52 },
-    {  2, 28,   .00, + 1, 57, 38.9, 6.45 },
-    { 17, 49, 18.89, + 1, 57, 40.0, 6.47 },
-    {  5, 13, 31.61, + 1, 58,  5.2, 6.09 },
-    { 16, 30, 54.79, + 1, 59,  2.0, 3.82 },
-    { 11, 17, 17.40, + 2,  0, 38.2, 5.18 },
-    {  5, 50, 30.00, + 2,  1, 27.8, 5.98 },
-    { 17, 39,  8.50, + 2,  1, 41.2, 6.26 },
-    { 19, 17, 48.19, + 2,  1, 54.1, 6.19 },
-    { 18, 44, 49.90, + 2,  3, 36.0, 5.02 },
-    { 16, 47,  9.79, + 2,  3, 51.8, 6.10 },
-    {  4, 27,   .70, + 2,  4, 45.8, 6.23 },
-    { 13, 21, 41.59, + 2,  5, 13.9, 5.69 },
-    { 23, 53,  4.80, + 2,  5, 26.2, 6.28 },
-    { 15,  2, 54.00, + 2,  5, 29.0, 4.40 },
-    {  8, 25, 35.50, + 2,  6,  7.9, 5.73 },
-    { 23, 36, 23.30, + 2,  6,  7.9, 5.68 },
-    { 23,  8, 40.90, + 2,  7, 40.1, 5.40 },
-    { 17, 16, 14.21, + 2, 11, 10.0, 6.17 },
-    { 15, 50, 17.50, + 2, 11, 47.0, 5.23 },
-    { 23, 48, 49.30, + 2, 12, 51.1, 6.46 },
-    {  7, 58, 20.59, + 2, 13, 28.9, 5.29 },
-    { 21, 39, 33.31, + 2, 14, 37.0, 5.10 },
-    {  2, 31, 30.10, + 2, 16,  1.9, 5.25 },
-    {  6, 21, 25.80, + 2, 16,  7.0, 6.31 },
-    { 21,  4, 45.41, + 2, 16, 10.9, 6.33 },
-    {  6, 25, 46.61, + 2, 16, 19.9, 6.51 },
-    { 10, 21,  1.99, + 2, 17, 22.9, 6.66 },
-    { 19, 13, 42.70, + 2, 17, 37.0, 5.15 },
-    { 14,  4, 37.49, + 2, 17, 51.0, 6.28 },
-    {  9, 14, 21.89, + 2, 18, 51.1, 3.88 },
-    {  8,  2, 15.91, + 2, 20,  3.8, 4.39 },
-    { 16, 26, 50.11, + 2, 20, 51.0, 6.07 },
-    {  5, 24, 36.19, + 2, 21, 10.1, 6.32 },
-    { 10, 24, 13.10, + 2, 22,  5.2, 6.32 },
-    { 18, 16,  5.59, + 2, 22, 40.1, 6.01 },
-    {  7, 44,  7.39, + 2, 24, 18.0, 6.47 },
-    { 14, 12, 15.79, + 2, 24, 33.8, 5.01 },
-    {  6, 47, 51.60, + 2, 24, 43.9, 4.47 },
-    {  4, 54, 15.10, + 2, 26, 26.2, 3.72 },
-    {  1, 10, 33.60, + 2, 26, 44.2, 5.95 },
-    {  9, 52, 12.19, + 2, 27, 15.1, 6.02 },
-    { 18, 56, 25.61, + 2, 28, 16.0, 6.15 },
-    { 10, 45,  9.41, + 2, 29, 17.2, 6.28 },
-    {  6,  8, 57.89, + 2, 29, 57.8, 5.73 },
-    { 18,  5, 27.29, + 2, 29, 57.8, 4.03 },
-    {  4, 53, 22.80, + 2, 30, 29.2, 5.33 },
-    { 15, 44,  1.80, + 2, 30, 54.0, 5.88 },
-    { 18, 57, 16.61, + 2, 32,  7.1, 5.57 },
-    { 17, 44, 35.40, + 2, 34, 44.0, 6.56 },
-    { 17, 44, 34.01, + 2, 34, 45.8, 6.17 },
-    {  5, 19, 11.21, + 2, 35, 44.9, 5.34 },
-    {  6, 29, 14.90, + 2, 38, 46.0, 6.16 },
-    { 21, 47, 13.99, + 2, 41, 10.0, 5.64 },
-    {  6, 37, 40.30, + 2, 42, 15.1, 6.17 },
-    { 17, 47, 53.59, + 2, 42, 25.9, 3.75 },
-    { 17, 31, 21.29, + 2, 43, 27.8, 5.59 },
-    {  7, 34, 46.01, + 2, 43, 30.0, 6.55 },
-    {  7, 19, 22.39, + 2, 44, 26.2, 5.89 },
-    {  8, 35, 24.89, + 2, 44, 37.0, 6.33 },
-    {  2,  2,  2.81, + 2, 45, 49.0, 5.23 },
-    {  2,  2,  2.81, + 2, 45, 49.0, 4.33 },
-    {  4,  4,  9.89, + 2, 49, 36.8, 5.36 },
-    { 11, 27, 56.21, + 2, 51, 22.0, 4.95 },
-    {  5, 13, 17.50, + 2, 51, 40.0, 4.46 },
-    { 19, 30, 10.51, + 2, 54, 15.1, 6.09 },
-    {  6, 27, 20.40, + 2, 54, 29.2, 5.55 },
-    { 19, 35, 25.20, + 2, 54, 47.9, 6.38 },
-    { 19, 28, 20.81, + 2, 55, 49.1, 5.85 },
-    { 23, 51, 57.89, + 2, 55, 49.1, 5.55 },
-    { 18,  0, 38.71, + 2, 55, 54.1, 3.97 },
-    { 20, 28, 16.80, + 2, 56, 12.8, 6.21 },
-    { 13, 20, 41.59, + 2, 56, 30.1, 6.26 },
-    { 21,  4, 41.69, + 2, 56, 30.8, 6.42 },
-    { 21,  9, 58.30, + 2, 56, 35.9, 6.45 },
-    { 23,  0, 42.89, + 3,  0, 42.1, 5.83 },
-    { 11, 26, 45.31, + 3,  0, 47.2, 6.50 },
-    {  6, 43,  6.50, + 3,  1, 59.9, 6.19 },
-    {  6, 51, 39.29, + 3,  2, 30.1, 6.38 },
-    { 12, 51, 36.89, + 3,  3, 24.1, 6.02 },
-    {  3, 39, 51.10, + 3,  3, 24.8, 5.57 },
-    { 11, 34, 22.01, + 3,  3, 36.0, 5.77 },
-    {  5, 26, 50.21, + 3,  5, 44.2, 4.59 },
-    {  2,  0,  9.19, + 3,  5, 49.9, 5.88 },
-    {  7, 14, 19.99, + 3,  6, 41.0, 5.35 },
-    { 19, 25, 29.90, + 3,  6, 52.9, 3.36 },
-    { 18,  9, 54.00, + 3,  7, 10.9, 5.69 },
-    {  0, 37, 30.50, + 3,  8,  7.1, 6.39 },
-    {  1, 53, 33.31, + 3, 11, 15.0, 4.62 },
-    { 10,  4,  8.40, + 3, 12,  4.0, 6.45 },
-    {  5, 54, 15.70, + 3, 13, 31.1, 6.31 },
-    {  2, 43, 18.00, + 3, 14,  8.9, 3.47 },
-    {  7, 52,  7.20, + 3, 16, 37.9, 6.31 },
-    {  7, 50, 47.40, + 3, 16, 37.9, 6.18 },
-    { 23, 17,  9.91, + 3, 16, 55.9, 3.69 },
-    { 12, 38,  4.39, + 3, 16, 57.0, 6.33 },
-    {  7, 33, 11.59, + 3, 17, 25.1, 5.59 },
-    {  5, 31, 14.50, + 3, 17, 31.9, 5.46 },
-    { 20, 47, 47.81, + 3, 18, 24.1, 6.40 },
-    { 12, 20, 21.00, + 3, 18, 45.0, 4.96 },
-    { 18, 10, 40.30, + 3, 19, 27.1, 5.51 },
-    { 19,  4, 10.70, + 3, 19, 50.2, 6.73 },
-    { 14, 14, 52.99, + 3, 20, 10.0, 6.45 },
-    {  8, 38, 45.41, + 3, 20, 29.0, 4.44 },
-    {  3, 19, 21.70, + 3, 22, 13.1, 4.83 },
-    {  7, 34, 15.79, + 3, 22, 17.0, 5.81 },
-    { 18, 20, 52.10, + 3, 22, 37.9, 4.86 },
-    { 19, 38, 49.01, + 3, 22, 54.1, 6.35 },
-    {  9, 59, 43.10, + 3, 23,  4.9, 6.70 },
-    {  0, 51, 18.31, + 3, 23,  6.0, 6.37 },
-    { 12, 55, 36.19, + 3, 23, 51.0, 3.38 },
-    {  8, 43, 13.49, + 3, 23, 55.0, 4.30 },
-    {  2, 38, 36.91, + 3, 26, 35.2, 6.21 },
-    { 19, 30, 33.10, + 3, 26, 39.8, 6.05 },
-    { 16,  8, 58.90, + 3, 27, 15.8, 5.91 },
-    { 23, 46, 23.50, + 3, 29, 12.1, 5.04 },
-    {  1, 26, 53.50, + 3, 32,  7.1, 6.58 },
-    { 13, 43,  3.70, + 3, 32, 17.2, 5.36 },
-    {  5, 22, 49.99, + 3, 32, 39.8, 5.00 },
-    { 12, 47, 51.41, + 3, 34, 22.1, 6.41 },
-    {  4, 48, 44.59, + 3, 35, 17.9, 6.03 },
-    {  6, 58, 57.00, + 3, 36,  7.9, 5.97 },
-    {  1, 17, 48.00, + 3, 36, 51.8, 5.16 },
-    {  5,  0, 32.59, + 3, 36, 55.1, 7.03 },
-    {  5,  0, 33.91, + 3, 36, 58.0, 6.66 },
-    { 11,  0, 33.60, + 3, 37,  3.0, 4.84 },
-    {  7, 41, 35.21, + 3, 37, 28.9, 5.94 },
-    { 11, 59, 56.90, + 3, 39, 19.1, 5.37 },
-    { 13, 34,  7.90, + 3, 39, 32.0, 4.94 },
-    { 18, 32,  7.01, + 3, 39, 34.9, 6.43 },
-    {  3, 21,  6.79, + 3, 40, 32.2, 5.69 },
-    {  1, 48, 25.99, + 3, 41,  8.2, 5.91 },
-    { 13, 18, 51.10, + 3, 41, 16.1, 6.62 },
-    { 18, 27, 50.30, + 3, 44, 55.0, 6.07 },
-    {  6, 23, 18.50, + 3, 45, 51.8, 6.40 },
-    {  5, 34, 16.70, + 3, 46,   .8, 5.36 },
-    { 17, 48, 20.21, + 3, 48, 15.1, 6.22 },
-    { 22, 57, 32.81, + 3, 48, 37.1, 6.28 },
-    { 23,  3, 52.61, + 3, 49, 12.0, 4.53 },
-    { 11, 25, 49.99, + 3, 51, 36.0, 6.37 },
-    {  9, 12, 12.91, + 3, 52,  1.9, 6.14 },
-    {  6, 43, 38.69, + 3, 55, 55.9, 5.90 },
-    {  8, 19, 49.90, + 3, 56, 52.1, 6.05 },
-    { 18,  9, 33.79, + 3, 59, 35.9, 5.73 },
-    {  5, 45,  1.90, + 4,  0, 29.2, 6.09 },
-    {  5, 21, 19.30, + 4,  0, 42.8, 6.57 },
-    { 18, 30,  5.09, + 4,  3, 55.1, 6.69 },
-    {  3,  2, 16.80, + 4,  5, 22.9, 2.53 },
-    {  5, 39, 11.09, + 4,  7, 17.0, 4.57 },
-    { 17, 26, 30.91, + 4,  8, 25.1, 4.34 },
-    {  6,  4, 58.39, + 4,  9, 31.0, 5.63 },
-    { 18, 56, 14.59, + 4, 12,  6.8, 4.98 },
-    { 18, 56, 13.20, + 4, 12, 13.0, 4.62 },
-    {  5, 30, 19.80, + 4, 12, 15.1, 6.21 },
-    { 16, 40, 35.11, + 4, 12, 25.9, 6.93 },
-    { 16, 40, 38.71, + 4, 13, 10.9, 5.77 },
-    {  8, 56, 36.89, + 4, 14, 12.1, 6.14 },
-    { 18, 48,  2.71, + 4, 14, 29.0, 6.21 },
-    {  6, 15, 46.99, + 4, 17,  1.0, 6.64 },
-    { 20, 59,  4.39, + 4, 17, 37.0, 5.23 },
-    {  7, 48, 58.90, + 4, 19, 58.1, 6.53 },
-    {  8, 43, 59.69, + 4, 20,  4.9, 6.37 },
-    {  9, 50, 30.10, + 4, 20, 37.0, 6.24 },
-    {  3,  2, 22.51, + 4, 21, 10.1, 5.61 },
-    { 18,  0, 15.79, + 4, 22,  7.0, 4.64 },
-    { 22, 26, 37.39, + 4, 23, 37.0, 5.75 },
-    { 19, 53, 22.61, + 4, 24,  2.2, 6.53 },
-    {  5, 50, 13.10, + 4, 25, 23.9, 5.97 },
-    { 16,  0, 51.10, + 4, 25, 39.0, 5.83 },
-    { 22, 29, 58.01, + 4, 25, 54.1, 5.48 },
-    { 15, 50, 49.01, + 4, 28, 40.1, 3.71 },
-    {  7, 56, 23.90, + 4, 29,  8.9, 6.17 },
-    {  6, 36,   .00, + 4, 29, 51.0, 6.55 },
-    {  2, 57,  4.61, + 4, 30,  4.0, 6.11 },
-    { 20, 55, 40.70, + 4, 31, 58.1, 6.05 },
-    { 17, 43, 28.39, + 4, 34,  1.9, 2.77 },
-    { 14, 59, 23.11, + 4, 34,  4.1, 5.93 },
-    {  6, 23, 46.10, + 4, 35, 34.1, 4.44 },
-    {  6, 23, 46.49, + 4, 35, 44.2, 6.72 },
-    { 10, 12, 48.29, + 4, 36, 52.9, 5.77 },
-    {  9, 38, 27.31, + 4, 38, 57.1, 4.68 },
-    { 22, 27, 51.50, + 4, 41, 44.2, 4.79 },
-    {  6, 38, 49.51, + 4, 42,  2.2, 6.57 },
-    {  2, 45, 20.90, + 4, 42, 42.1, 6.03 },
-    { 10, 43, 20.90, + 4, 44, 52.1, 5.79 },
-    {  8, 33, 43.49, + 4, 45, 24.1, 5.87 },
-    { 14, 30, 45.41, + 4, 46, 19.9, 6.02 },
-    {  7,  1, 41.40, + 4, 49,  5.2, 6.63 },
-    { 19, 16, 31.01, + 4, 50,  4.9, 5.59 },
-    {  6, 32, 19.20, + 4, 51, 20.9, 5.84 },
-    {  8,  1, 13.80, + 4, 52, 46.9, 5.65 },
-    {  3, 23, 39.10, + 4, 52, 54.8, 6.38 },
-    { 14,  3, 55.80, + 4, 54,  2.9, 6.24 },
-    {  1,  5, 49.20, + 4, 54, 29.9, 6.35 },
-    {  1,  5, 51.41, + 4, 54, 33.8, 7.25 },
-    {  7,  7,  6.41, + 4, 54, 37.1, 6.11 },
-    { 15, 15, 11.40, + 4, 56, 21.8, 5.33 },
-    {  6, 37, 52.70, + 4, 57, 25.9, 6.15 },
-    { 16,  3, 45.70, + 4, 59, 12.1, 6.08 },
-    { 16, 13, 15.41, + 5,  1, 16.0, 5.48 },
-    { 22,  5, 40.80, + 5,  3, 31.0, 4.84 },
-    { 18, 25,  8.81, + 5,  5,  4.9, 6.74 },
-    {  9,  5, 58.39, + 5,  5, 31.9, 4.97 },
-    {  6, 17, 16.10, + 5,  6,  1.1, 5.71 },
-    { 13, 22,  9.70, + 5,  9, 16.9, 5.87 },
-    {  5, 14, 44.09, + 5,  9, 22.0, 5.50 },
-    {  7, 39, 18.10, + 5, 13, 30.0, 0.38 },
-    {  7, 40,  7.01, + 5, 13, 50.9, 6.02 },
-    { 16, 47, 46.39, + 5, 14, 48.1, 5.24 },
-    { 21, 15, 49.39, + 5, 14, 52.1, 3.92 },
-    { 18, 39, 36.89, + 5, 15, 51.1, 6.38 },
-    {  0, 48, 22.99, + 5, 16, 50.2, 5.75 },
-    { 12, 22, 31.99, + 5, 18, 20.2, 6.40 },
-    {  5, 23, 31.10, + 5, 19, 21.0, 6.35 },
-    {  3,  1, 52.30, + 5, 20, 10.0, 6.25 },
-    {  8, 52, 24.19, + 5, 20, 24.0, 6.33 },
-    { 20, 23, 10.70, + 5, 20, 35.2, 5.31 },
-    { 23, 20, 20.59, + 5, 22, 53.0, 5.05 },
-    { 19, 39, 11.59, + 5, 23, 52.1, 5.17 },
-    {  4, 55, 58.39, + 5, 23, 57.1, 6.50 },
-    {  4, 32,  4.80, + 5, 24, 36.0, 6.39 },
-    {  6,  4, 58.20, + 5, 25, 12.0, 5.67 },
-    {  4,  3, 44.59, + 5, 26,  8.2, 5.33 },
-    { 18, 21, 28.49, + 5, 26,  8.9, 6.13 },
-    { 15, 45, 23.50, + 5, 26, 48.8, 5.58 },
-    {  9, 11, 55.61, + 5, 28,  5.9, 6.35 },
-    { 13, 17, 36.29, + 5, 28, 10.9, 4.80 },
-    {  7, 12,  7.39, + 5, 28, 28.9, 6.16 },
-    {  1, 41, 25.90, + 5, 29, 15.0, 4.44 },
-    { 15,  4,  6.41, + 5, 29, 33.0, 6.50 },
-    { 13, 50, 24.70, + 5, 29, 49.9, 6.01 },
-    { 15,  7, 40.30, + 5, 29, 53.2, 6.16 },
-    { 18, 45, 28.39, + 5, 29, 58.9, 5.83 },
-    { 21,  4, 34.70, + 5, 30, 10.1, 5.61 },
-    { 19, 13, 44.09, + 5, 30, 56.9, 6.49 },
-    { 16, 32, 35.69, + 5, 31, 16.0, 5.63 },
-    {  4, 11, 20.30, + 5, 31, 23.2, 5.72 },
-    { 20, 49, 59.09, + 5, 32, 40.9, 6.21 },
-    {  7,  1, 55.01, + 5, 33, 27.0, 6.59 },
-    {  4, 34,  8.30, + 5, 34,  7.0, 5.68 },
-    {  2, 35, 52.51, + 5, 35, 35.9, 4.86 },
-    {  4, 51, 12.41, + 5, 36, 18.0, 3.69 },
-    { 10,  6, 47.40, + 5, 36, 41.0, 6.21 },
-    { 23, 39, 57.00, + 5, 37, 35.0, 4.13 },
-    {  9,  1, 31.39, + 5, 38, 26.9, 6.07 },
-    {  1,  8, 22.20, + 5, 38, 58.9, 5.52 },
-    {  7, 11, 51.31, + 5, 39, 16.9, 6.09 },
-    {  1,  4, 52.61, + 5, 39, 23.0, 6.00 },
-    { 21, 42, 15.50, + 5, 40, 48.0, 5.30 },
-    {  8, 45,  1.30, + 5, 40, 50.2, 6.13 },
-    { 10, 23, 14.59, + 5, 41, 39.1, 6.54 },
-    {  8, 37, 39.41, + 5, 42, 13.0, 4.16 },
-    { 21, 38, 31.90, + 5, 46, 18.1, 5.67 },
-    { 22, 20, 27.60, + 5, 47, 21.8, 5.37 },
-    { 12, 10,  3.41, + 5, 48, 24.8, 5.72 },
-    { 14, 24, 11.30, + 5, 49, 12.0, 5.10 },
-    {  8, 48, 25.99, + 5, 50, 16.1, 4.36 },
-    {  7, 36, 34.70, + 5, 51, 42.1, 5.91 },
-    { 16, 14, 13.49, + 5, 54,  6.8, 6.31 },
-    {  8, 55, 23.59, + 5, 56, 44.2, 3.11 },
-    {  5, 30, 47.11, + 5, 56, 53.2, 4.20 },
-    { 12, 47,  2.30, + 5, 57,  2.9, 6.34 },
-    {  9, 53, 42.91, + 5, 57, 29.9, 5.95 },
-    { 21,  5, 26.69, + 5, 57, 29.9, 5.94 },
-    {  4,  3,  9.41, + 5, 59, 21.1, 3.91 },
-    { 20, 47, 48.31, + 6,  0, 29.9, 5.58 },
-    { 13, 29, 57.60, + 6,  0, 47.9, 6.51 },
-    { 11, 21,  8.21, + 6,  1, 45.8, 4.05 },
-    {  3, 57,  1.70, + 6,  2, 24.0, 6.09 },
-    {  3, 45, 40.39, + 6,  3,   .0, 5.35 },
-    {  6, 15, 40.10, + 6,  3, 58.0, 6.07 },
-    { 19,  8, 59.90, + 6,  4, 23.9, 5.22 },
-    { 17, 18, 52.80, + 6,  5,  7.1, 6.51 },
-    { 17, 53, 14.21, + 6,  6,  5.0, 5.77 },
-    { 11,  0, 44.81, + 6,  6,  5.0, 4.99 },
-    {  2, 40, 15.70, + 6,  6, 42.8, 6.25 },
-    {  4, 20, 41.21, + 6,  7, 50.9, 5.77 },
-    {  6, 37, 24.10, + 6,  8,  7.1, 6.06 },
-    {  1, 30, 11.09, + 6,  8, 38.0, 4.84 },
-    { 10, 56,  1.51, + 6, 11,  7.1, 5.81 },
-    {  4, 15, 29.21, + 6, 11, 12.1, 6.31 },
-    {  3, 30, 45.41, + 6, 11, 19.0, 5.94 },
-    { 18, 27, 58.80, + 6, 11, 39.1, 5.73 },
-    { 22, 10, 12.00, + 6, 11, 52.1, 3.53 },
-    {  4, 15, 25.80, + 6, 11, 58.9, 6.93 },
-    { 18, 58, 23.81, + 6, 14, 25.1, 6.21 },
-    { 18,  0, 52.90, + 6, 16,  5.9, 6.34 },
-    { 17, 41, 32.30, + 6, 18, 46.1, 5.95 },
-    {  6, 41, 59.30, + 6, 20, 42.0, 6.37 },
-    {  5, 25,  7.90, + 6, 20, 58.9, 1.64 },
-    { 13, 46, 57.10, + 6, 21,  2.2, 6.33 },
-    {  6, 40, 31.80, + 6, 22, 18.1, 6.51 },
-    { 10, 46,  5.69, + 6, 22, 23.2, 6.37 },
-    { 16,  9, 11.21, + 6, 22, 44.0, 5.97 },
-    { 23, 27, 58.10, + 6, 22, 44.0, 4.28 },
-    { 19, 55, 18.79, + 6, 24, 24.1, 3.71 },
-    {  3, 34, 49.20, + 6, 25,  4.1, 6.49 },
-    {  8, 46, 46.61, + 6, 25,  8.0, 3.38 },
-    { 15, 44, 16.10, + 6, 25, 32.2, 2.65 },
-    {  5, 48,   .19, + 6, 27, 15.1, 5.27 },
-    {  0, 59, 49.70, + 6, 28, 59.2, 6.11 },
-    { 17, 56, 55.99, + 6, 29, 16.1, 6.29 },
-    { 11, 45, 51.60, + 6, 31, 45.8, 4.03 },
-    {  3, 52,   .19, + 6, 32,  4.9, 5.67 },
-    { 10, 23,   .41, + 6, 32, 33.0, 6.07 },
-    { 17,  0, 29.40, + 6, 35,  1.0, 6.59 },
-    { 12,  0, 52.39, + 6, 36, 51.1, 4.66 },
-    { 18, 55, 27.50, + 6, 36, 55.1, 5.57 },
-    { 23,  4,  1.01, + 6, 37,   .1, 6.41 },
-    { 21, 37, 43.70, + 6, 37,  5.9, 6.18 },
-    {  8, 35, 51.00, + 6, 37, 12.0, 5.99 },
-    {  8, 35, 51.29, + 6, 37, 21.0, 7.25 },
-    {  3, 12, 26.40, + 6, 39, 38.9, 5.56 },
-    { 18, 36, 39.10, + 6, 40, 18.8, 5.45 },
-    {  7, 17, 17.81, + 6, 40, 50.2, 6.65 },
-    {  9, 46, 10.01, + 6, 42, 31.0, 5.79 },
-    { 22,  0,  7.90, + 6, 43,  3.0, 6.00 },
-    {  0, 47, 23.59, + 6, 44, 26.9, 5.99 },
-    {  3, 46,  9.50, + 6, 48, 11.2, 5.91 },
-    { 12, 41, 57.10, + 6, 48, 24.1, 5.59 },
-    { 21, 22, 53.59, + 6, 48, 40.0, 5.16 },
-    {  9, 37, 12.70, + 6, 50,  8.9, 5.00 },
-    { 23, 59, 18.70, + 6, 51, 47.9, 4.01 },
-    { 21, 53, 57.79, + 6, 51, 51.8, 6.15 },
-    {  5, 26, 38.81, + 6, 52,  9.1, 6.42 },
-    {  2, 36,  4.90, + 6, 53, 12.8, 5.82 },
-    {  7, 28,  2.11, + 6, 56, 30.8, 5.25 },
-    { 16, 24, 10.80, + 6, 56, 53.2, 5.85 },
-    { 10, 34, 48.00, + 6, 57, 13.0, 5.08 },
-    {  0, 32, 23.81, + 6, 57, 20.2, 5.67 },
-    {  4, 49, 50.40, + 6, 57, 41.0, 3.19 },
-    { 12, 38, 30.00, + 6, 59, 17.9, 7.08 },
-    { 21,  8, 28.20, + 6, 59, 21.8, 6.15 },
-    {  1, 14, 42.41, + 6, 59, 43.1, 6.03 },
-    {  6, 16, 58.39, + 7,  3, 11.2, 6.57 },
-    { 23, 55,  7.80, + 7,  4, 16.0, 6.21 },
-    {  6, 25, 13.10, + 7,  5,  8.9, 5.98 },
-    { 19, 54, 40.30, + 7,  8, 25.1, 6.15 },
-    {  7, 19, 47.59, + 7,  8, 34.1, 5.91 },
-    { 13, 30,   .10, + 7, 10, 44.0, 6.17 },
-    {  7, 58,  5.81, + 7, 12, 49.0, 6.41 },
-    { 16, 50, 19.39, + 7, 14, 52.1, 5.49 },
-    { 23, 41, 56.69, + 7, 15,  2.2, 5.89 },
-    { 18, 19,  9.50, + 7, 15, 34.9, 5.39 },
-    { 20,  4,  8.30, + 7, 16, 41.2, 5.52 },
-    {  9,  2, 44.81, + 7, 17, 53.2, 5.85 },
-    {  0, 48, 17.40, + 7, 18,   .0, 5.93 },
-    {  6, 59, 20.09, + 7, 19,   .8, 6.35 },
-    {  6, 32, 54.19, + 7, 19, 59.2, 4.50 },
-    { 11,  5,  1.01, + 7, 20, 10.0, 4.63 },
-    { 22, 58, 42.60, + 7, 20, 22.9, 6.33 },
-    { 15, 46, 26.59, + 7, 21, 11.2, 4.43 },
-    { 21, 21,  4.80, + 7, 21, 15.8, 5.82 },
-    { 18, 39, 51.60, + 7, 21, 29.9, 6.28 },
-    { 19, 34,  5.40, + 7, 22, 44.0, 4.45 },
-    {  5, 55, 10.30, + 7, 24, 24.8, 0.50 },
-    {  7,  7, 49.51, + 7, 28, 16.0, 5.75 },
-    {  2, 35,  4.10, + 7, 28, 17.0, 6.18 },
-    { 21,  0,  3.89, + 7, 30, 59.0, 5.99 },
-    {  5, 38,  1.10, + 7, 32, 29.0, 5.88 },
-    { 14,  3, 36.79, + 7, 32, 47.0, 6.26 },
-    {  8, 25, 54.79, + 7, 33, 51.8, 5.13 },
-    {  6, 34, 46.39, + 7, 34, 21.0, 6.45 },
-    {  1, 13, 43.90, + 7, 34, 31.1, 5.24 },
-    {  1, 13, 45.29, + 7, 34, 41.9, 6.30 },
-    {  0, 48, 40.99, + 7, 35,  6.0, 4.43 },
-    { 17, 26, 19.01, + 7, 35, 44.2, 6.06 },
-    { 12, 31, 21.41, + 7, 36, 15.1, 6.05 },
-    { 19, 45, 39.91, + 7, 36, 47.9, 5.91 },
-    {  6, 58, 39.00, + 7, 37, 18.8, 6.27 },
-    { 12, 45, 37.10, + 7, 40, 23.9, 5.22 },
-    {  2, 38,   .79, + 7, 41, 43.1, 6.39 },
-    {  4, 13, 33.10, + 7, 42, 58.0, 5.29 },
-    {  2, 36, 35.11, + 7, 43, 46.9, 5.81 },
-    {  4, 54, 47.81, + 7, 46, 45.1, 5.33 },
-    { 20, 49, 48.31, + 7, 51, 51.1, 6.33 },
-    {  4, 39,  6.19, + 7, 52, 14.9, 5.39 },
-    {  1,  2, 56.59, + 7, 53, 24.0, 4.28 },
-    { 17, 11, 45.19, + 7, 53, 40.9, 6.33 },
-    { 19, 50, 17.50, + 7, 54,  9.0, 6.51 },
-    {  1, 28, 22.90, + 7, 57, 41.0, 6.20 },
-    {  7, 15, 39.41, + 7, 58, 40.1, 5.82 },
-    {  8, 39, 24.60, + 8,  1,  1.9, 6.45 },
-    { 18, 25, 38.81, + 8,  1, 54.8, 5.65 },
-    {  6, 47, 19.80, + 8,  2, 13.9, 4.77 },
-    { 10,  0, 12.79, + 8,  2, 39.1, 4.70 },
-    { 11, 14,  1.80, + 8,  3, 38.2, 5.79 },
-    { 14, 24, 18.29, + 8,  5,  6.0, 6.19 },
-    { 16,  5, 37.80, + 8,  5, 46.0, 6.29 },
-    { 11, 38, 27.60, + 8,  8,  3.1, 5.36 },
-    { 14, 41, 38.81, + 8,  9, 42.1, 4.86 },
-    { 22, 20, 55.80, + 8, 11, 12.1, 6.17 },
-    {  9, 28, 29.21, + 8, 11, 17.9, 5.71 },
-    {  0, 20, 35.90, + 8, 11, 25.1, 5.37 },
-    { 21, 28, 24.79, + 8, 11, 44.2, 6.40 },
-    {  4,  3, 56.59, + 8, 11, 49.9, 5.46 },
-    { 19,  6, 22.20, + 8, 13, 48.0, 6.09 },
-    {  0, 16, 34.10, + 8, 14, 24.0, 6.11 },
-    { 14, 24,   .91, + 8, 14, 37.0, 5.95 },
-    { 11, 47, 54.89, + 8, 14, 44.9, 5.32 },
-    {  2,  6, 12.31, + 8, 14, 51.0, 6.31 },
-    { 22,  1,  9.19, + 8, 15, 25.9, 5.65 },
-    { 11, 45, 17.09, + 8, 15, 29.9, 4.85 },
-    { 18, 33, 23.30, + 8, 16,  5.9, 6.42 },
-    {  7, 27,  9.00, + 8, 17, 21.8, 2.90 },
-    {  9, 58,  7.61, + 8, 18, 51.1, 6.04 },
-    {  6, 55, 34.61, + 8, 19, 28.9, 6.29 },
-    { 19,  2, 21.60, + 8, 22, 27.1, 6.30 },
-    {  6, 52, 49.39, + 8, 22, 49.1, 5.77 },
-    {  2, 56, 13.80, + 8, 22, 54.1, 5.97 },
-    { 13, 42, 12.70, + 8, 23, 17.9, 6.16 },
-    {  5, 21, 43.61, + 8, 25, 43.0, 5.80 },
-    { 20, 28,  7.49, + 8, 26, 15.0, 6.25 },
-    { 11, 55,  3.10, + 8, 26, 38.0, 5.58 },
-    { 14, 23, 22.61, + 8, 26, 42.0, 6.86 },
-    { 14, 23, 22.70, + 8, 26, 48.1, 5.12 },
-    { 17,  1, 59.09, + 8, 27,  2.2, 6.33 },
-    {  8, 34, 13.30, + 8, 27,  6.8, 6.03 },
-    {  2, 28,  9.50, + 8, 27, 36.0, 4.28 },
-    { 19, 54, 14.90, + 8, 27, 41.0, 4.71 },
-    {  3,  8, 38.71, + 8, 28, 14.9, 6.28 },
-    {  0,  2, 29.69, + 8, 29,  8.2, 5.63 },
-    {  5,  7, 52.90, + 8, 29, 53.9, 5.34 },
-    { 16,  8, 28.01, + 8, 32,  3.1, 5.73 },
-    { 22, 15, 59.81, + 8, 32, 57.8, 6.21 },
-    { 20,  0, 58.90, + 8, 33, 29.2, 5.91 },
-    {  2, 11, 21.10, + 8, 34, 10.9, 5.63 },
-    { 15, 30, 55.39, + 8, 34, 45.1, 6.57 },
-    { 15, 54, 40.30, + 8, 34, 49.1, 6.29 },
-    { 16, 45, 49.90, + 8, 34, 57.0, 5.15 },
-    {  6, 46, 32.40, + 8, 35, 13.9, 5.93 },
-    {  4, 26, 21.10, + 8, 35, 25.1, 6.06 },
-    { 12, 27, 42.10, + 8, 36, 37.1, 6.37 },
-    {  7, 57, 15.91, + 8, 38, 29.0, 6.05 },
-    { 10, 35,  2.21, + 8, 39,  1.1, 5.67 },
-    {  6,  8, 47.21, + 8, 40, 12.0, 6.55 },
-    { 23,  9, 31.51, + 8, 40, 37.9, 5.12 },
-    { 23, 11, 44.21, + 8, 43, 12.0, 5.16 },
-    { 12,  5, 12.50, + 8, 43, 59.2, 4.12 },
-    { 18,  7, 18.41, + 8, 44,  2.0, 4.64 },
-    { 10, 25, 15.19, + 8, 47,  4.9, 5.61 },
-    { 22, 55, 13.70, + 8, 48, 56.9, 4.90 },
-    {  0, 14, 58.80, + 8, 49, 14.9, 5.79 },
-    { 18, 38, 21.00, + 8, 50,  2.0, 6.40 },
-    {  2, 13,   .00, + 8, 50, 48.1, 4.37 },
-    { 17, 23, 57.60, + 8, 51, 10.1, 5.77 },
-    {  7, 55, 31.39, + 8, 51, 46.1, 5.86 },
-    {  8, 17, 31.70, + 8, 51, 58.0, 6.29 },
-    { 19, 50, 46.99, + 8, 52,  5.9, 0.77 },
-    { 11, 38,  9.79, + 8, 53,  3.1, 6.17 },
-    {  6, 24,  2.30, + 8, 53,  4.9, 6.26 },
-    {  4, 13, 31.30, + 8, 53, 26.2, 6.51 },
-    {  4, 15, 32.11, + 8, 53, 31.9, 4.29 },
-    { 14,  1, 20.40, + 8, 53, 40.9, 5.99 },
-    {  4, 50, 36.70, + 8, 54,  1.1, 4.36 },
-    {  2, 59, 42.89, + 8, 54, 27.0, 4.70 },
-    {  8,  1, 50.71, + 8, 54, 50.0, 6.22 },
-    {  7, 28,  9.79, + 8, 55, 32.2, 4.32 },
-    {  9, 56, 25.99, + 8, 55, 59.2, 5.85 },
-    {  5, 37, 19.30, + 8, 57,  6.8, 6.12 },
-    {  0,  2, 24.19, + 8, 57, 24.8, 6.32 },
-    {  3, 24, 48.79, + 9,  1, 44.0, 3.60 },
-    {  6, 30,  5.50, + 9,  1, 45.1, 6.57 },
-    {  6, 18, 40.49, + 9,  2, 49.9, 6.24 },
-    {  9, 28, 27.50, + 9,  3, 24.1, 5.41 },
-    { 18, 36, 27.79, + 9,  7, 21.0, 5.39 },
-    { 22, 29,  7.99, + 9,  7, 44.0, 5.58 },
-    {  7,  3, 17.90, + 9,  8, 17.9, 5.97 },
-    {  1, 45, 23.59, + 9,  9, 28.1, 4.26 },
-    {  8, 16, 30.91, + 9, 11,  8.2, 3.52 },
-    {  7,  5, 39.10, + 9, 11,  8.9, 5.78 },
-    {  4, 20, 49.01, + 9, 13, 32.2, 6.53 },
-    {  4, 13, 56.40, + 9, 15, 49.0, 4.84 },
-    {  7, 25, 38.90, + 9, 16, 34.0, 4.99 },
-    {  5, 36, 54.29, + 9, 17, 26.2, 4.09 },
-    { 10, 32, 48.70, + 9, 18, 24.1, 3.85 },
-    { 23, 51, 21.19, + 9, 18, 47.9, 5.79 },
-    { 22, 58, 35.09, + 9, 21, 24.8, 6.43 },
-    {  3, 32, 36.00, + 9, 22, 25.0, 5.77 },
-    { 16, 57, 40.10, + 9, 22, 30.0, 3.20 },
-    {  8, 57, 42.00, + 9, 23, 16.1, 6.19 },
-    { 20,  7, 50.30, + 9, 23, 58.9, 6.43 },
-    { 23,  7,   .31, + 9, 24, 33.8, 4.52 },
-    {  4, 33, 48.10, + 9, 24, 47.2, 6.01 },
-    { 13, 16, 46.51, + 9, 25, 27.1, 5.22 },
-    {  4, 23, 51.89, + 9, 27, 38.9, 5.12 },
-    {  5,  7, 38.30, + 9, 28, 18.8, 6.17 },
-    {  4, 18, 24.50, + 9, 29, 12.1, 6.54 },
-    {  5, 34, 49.20, + 9, 29, 21.8, 4.41 },
-    {  5, 56, 28.01, + 9, 30, 34.9, 5.99 },
-    {  5, 46, 52.10, + 9, 31, 19.9, 5.79 },
-    { 12, 46, 22.51, + 9, 32, 24.0, 5.67 },
-    { 18,  7, 21.00, + 9, 33, 50.0, 3.73 },
-    {  2, 29, 35.30, + 9, 33, 56.9, 6.07 },
-    {  8, 38,  5.21, + 9, 34, 28.9, 6.53 },
-    { 17, 34, 36.70, + 9, 35, 12.1, 5.81 },
-    { 19, 18, 52.70, + 9, 37,  5.2, 6.32 },
-    { 19, 51, 17.71, + 9, 37, 49.1, 6.25 },
-    {  6,  2, 22.99, + 9, 38, 51.0, 4.12 },
-    {  8, 37,  5.81, + 9, 39, 20.2, 5.88 },
-    { 23, 39, 55.10, + 9, 40, 37.9, 5.97 },
-    { 14,  2, 31.80, + 9, 41, 11.0, 6.20 },
-    { 16, 11, 29.69, + 9, 42, 45.0, 6.53 },
-    {  9, 31, 57.60, + 9, 42, 56.9, 5.07 },
-    {  3, 27, 10.20, + 9, 43, 58.1, 3.74 },
-    { 17,  6,  9.70, + 9, 43, 59.9, 6.37 },
-    { 10, 27, 39.00, + 9, 45, 45.0, 6.04 },
-    {  8, 31, 54.60, + 9, 48, 51.8, 6.83 },
-    {  8, 11, 16.61, + 9, 49, 16.0, 6.07 },
-    { 23, 10,  1.51, + 9, 49, 18.8, 5.39 },
-    {  5,  9, 19.61, + 9, 49, 45.8, 5.43 },
-    { 22, 52, 24.10, + 9, 50,  8.2, 5.16 },
-    {  5, 50,  2.59, + 9, 52, 16.0, 5.80 },
-    { 21, 44, 11.21, + 9, 52, 30.0, 2.39 },
-    { 16,  7, 37.49, + 9, 53, 30.1, 5.63 },
-    {  9, 41,  9.00, + 9, 53, 31.9, 3.52 },
-    {  6, 40, 58.70, + 9, 53, 44.2, 4.66 },
-    { 19, 22, 48.41, + 9, 54, 47.2, 6.35 },
-    {  5, 35,  8.30, + 9, 56,  3.1, 3.54 },
-    {  5, 35,  8.50, + 9, 56,  6.0, 5.61 },
-    {  6, 17,  6.60, + 9, 56, 33.0, 5.39 },
-    {  6, 56, 25.80, + 9, 57, 23.0, 5.92 },
-    {  4, 51, 43.39, + 9, 58, 30.0, 6.11 },
-    {  6, 35, 17.59, + 9, 59, 17.9, 5.88 },
-    { 10,  7, 54.31, + 9, 59, 51.0, 4.37 },
-    {  4,  1, 46.10, + 9, 59, 52.1, 5.67 },
-    { 21, 14, 28.90, +10,  0, 24.8, 4.49 },
-    { 15, 36, 29.59, +10,  0, 36.0, 5.26 },
-    {  4, 14, 36.29, +10,  0, 40.0, 5.22 },
-    { 13,  9, 12.41, +10,  1, 19.9, 5.78 },
-    { 21, 10, 31.20, +10,  2, 56.0, 6.07 },
-    { 20, 25, 43.99, +10,  3, 23.0, 6.33 },
-    { 20, 33, 53.59, +10,  3, 34.9, 6.56 },
-    {  8, 32, 39.89, +10,  3, 58.0, 6.46 },
-    {  8, 44, 45.00, +10,  4, 54.1, 5.66 },
-    { 20, 39,  7.80, +10,  5, 10.0, 5.05 },
-    { 14, 14, 50.81, +10,  6,  2.2, 5.29 },
-    {  2, 44, 56.50, +10,  6, 51.1, 4.27 },
-    {  4, 19, 37.49, +10,  7, 17.0, 6.31 },
-    { 21, 10, 20.50, +10,  7, 54.1, 4.69 },
-    { 18, 59, 17.50, +10,  8, 26.9, 6.75 },
-    {  4, 54, 53.81, +10,  9,  2.9, 4.65 },
-    {  4, 35, 39.29, +10,  9, 38.9, 4.25 },
-    { 16, 54,   .50, +10,  9, 55.1, 4.38 },
-    { 21, 24, 24.60, +10, 10, 27.1, 6.35 },
-    {  0, 28, 20.09, +10, 11, 22.9, 6.04 },
-    { 13, 35, 33.29, +10, 12, 16.9, 6.49 },
-    {  4, 13, 34.80, +10, 12, 43.9, 6.23 },
-    { 12, 41, 53.11, +10, 14,  8.2, 4.88 },
-    {  5, 35, 13.39, +10, 14, 24.0, 5.60 },
-    { 12, 13, 25.90, +10, 15, 43.9, 5.85 },
-    {  4, 30,  2.40, +10, 15, 45.0, 6.48 },
-    { 12, 33,  2.90, +10, 17, 44.2, 6.26 },
-    {  6, 28, 18.79, +10, 18, 14.0, 6.15 },
-    {  3, 59, 40.70, +10, 19, 50.9, 6.37 },
-    { 23, 43, 22.39, +10, 19, 53.0, 5.06 },
-    { 19, 52, 15.60, +10, 21,  5.0, 6.54 },
-    { 19, 51,  1.61, +10, 24, 56.2, 5.11 },
-    { 12, 41, 34.39, +10, 25, 35.0, 6.19 },
-    { 17,  6, 13.10, +10, 27, 15.1, 6.37 },
-    { 22, 49, 32.30, +10, 28, 44.0, 6.54 },
-    {  4, 29, 42.89, +10, 31, 18.1, 6.79 },
-    { 11, 23, 55.49, +10, 31, 45.1, 3.94 },
-    { 15, 34, 48.10, +10, 32, 15.0, 3.80 },
-    { 15, 34, 48.10, +10, 32, 21.1, 3.80 },
-    { 10, 49, 15.41, +10, 32, 43.1, 5.34 },
-    {  7, 34,  5.09, +10, 34,  5.9, 6.28 },
-    { 17, 12, 27.79, +10, 35,  7.1, 5.33 },
-    {  5, 54, 13.39, +10, 35, 12.8, 6.12 },
-    {  7, 26, 27.89, +10, 36, 29.9, 6.37 },
-    {  2, 24, 49.01, +10, 36, 38.2, 5.47 },
-    { 19, 46, 15.60, +10, 36, 47.9, 2.72 },
-    {  6, 13, 12.60, +10, 37, 39.0, 6.45 },
-    {  8, 23, 55.20, +10, 37, 54.8, 6.08 },
-    {  9,  7, 44.81, +10, 40,  5.2, 5.24 },
-    { 19, 48, 30.41, +10, 41, 39.1, 6.44 },
-    { 20,  8, 38.30, +10, 43, 32.9, 6.31 },
-    {  2, 42, 28.90, +10, 44, 30.1, 6.30 },
-    { 13, 39, 34.61, +10, 44, 46.0, 5.57 },
-    {  7, 46, 16.20, +10, 46,  5.9, 5.30 },
-    { 14,  3, 32.30, +10, 47, 12.1, 6.30 },
-    { 13, 29, 13.01, +10, 49,  5.9, 5.65 },
-    { 21, 42, 33.00, +10, 49, 28.9, 6.09 },
-    { 22, 41, 27.70, +10, 49, 53.0, 3.40 },
-    { 20, 58, 25.90, +10, 50, 21.1, 5.48 },
-    {  6, 37, 36.89, +10, 51, 11.2, 6.38 },
-    { 17, 18, 37.01, +10, 51, 51.8, 5.03 },
-    {  3,  0, 44.11, +10, 52, 13.1, 5.95 },
-    { 18, 34, 47.50, +10, 53, 30.1, 6.40 },
-    { 20, 30, 18.00, +10, 53, 44.9, 6.08 },
-    { 11, 35, 43.39, +10, 54, 40.0, 6.56 },
-    { 22, 43, 42.70, +10, 56, 21.1, 6.51 },
-    { 23, 52, 37.10, +10, 56, 51.0, 5.30 },
-    {  7,  3, 37.99, +10, 57,  6.1, 5.13 },
-    { 13,  2, 10.61, +10, 57, 33.1, 2.83 },
-    { 22,  2,  1.39, +10, 58, 26.0, 6.37 },
-    { 18, 50, 45.60, +10, 58, 35.0, 6.55 },
-    {  0, 20, 54.50, +10, 58, 36.8, 6.56 },
-    {  6, 53, 22.51, +10, 59, 47.0, 6.24 },
-    {  6, 41, 17.21, +11,  0, 11.9, 6.11 },
-    {  7, 26, 41.30, +11,  0, 33.1, 6.41 },
-    {  6, 29,   .00, +11,  1,  9.8, 6.59 },
-    { 11, 34, 10.01, +11,  1, 25.0, 6.55 },
-    {  5, 37,  4.39, +11,  2,  6.0, 5.94 },
-    {  1, 50, 52.01, +11,  2, 35.9, 5.94 },
-    { 17, 57, 26.90, +11,  2, 39.1, 6.36 },
-    { 23, 13, 26.50, +11,  3, 54.0, 5.82 },
-    { 19,  6, 58.61, +11,  4, 17.0, 5.09 },
-    { 17, 54, 14.21, +11,  7, 50.2, 6.38 },
-    {  3, 48, 16.30, +11,  8, 35.9, 5.07 },
-    {  0, 10,  2.30, +11,  8, 44.2, 5.51 },
-    {  4, 44, 25.80, +11,  8, 46.0, 5.40 },
-    { 19, 36,  7.99, +11,  9,   .0, 6.68 },
-    { 21, 18, 52.01, +11, 12, 11.9, 5.96 },
-    {  0, 18, 17.21, +11, 12, 20.9, 6.05 },
-    {  4, 27, 28.80, +11, 12, 45.0, 5.88 },
-    { 20, 39, 51.79, +11, 14, 58.9, 6.42 },
-    {  6, 31,  9.50, +11, 15,  2.9, 6.14 },
-    { 20, 31, 13.01, +11, 15, 38.2, 7.11 },
-    { 15, 35, 53.40, +11, 15, 56.2, 6.07 },
-    { 19, 36, 52.51, +11, 16, 23.9, 5.98 },
-    {  9, 31, 56.71, +11, 17, 58.9, 4.97 },
-    { 20, 33, 12.79, +11, 18, 11.9, 4.03 },
-    { 13, 14, 31.30, +11, 19, 54.1, 5.67 },
-    {  3, 30, 24.50, +11, 20, 11.0, 5.14 },
-    {  5, 16,  4.10, +11, 20, 29.0, 5.56 },
-    { 20, 37, 49.10, +11, 22, 40.1, 5.43 },
-    { 22,  3, 19.01, +11, 23, 11.0, 5.80 },
-    { 16, 26, 11.50, +11, 24, 27.0, 6.11 },
-    { 18, 37, 12.60, +11, 25, 18.1, 6.42 },
-    { 19, 56, 14.30, +11, 25, 26.0, 5.28 },
-    {  4, 54, 46.90, +11, 25, 34.0, 5.19 },
-    {  9, 47, 33.50, +11, 25, 44.0, 6.02 },
-    { 11, 24, 58.90, +11, 25, 49.1, 5.80 },
-    { 16, 32, 36.29, +11, 29, 17.2, 4.84 },
-    {  9, 17, 51.41, +11, 30,  4.0, 6.41 },
-    {  5, 56, 49.51, +11, 31, 16.0, 5.87 },
-    { 19, 19, 52.99, +11, 32,  6.0, 6.02 },
-    {  6, 31, 48.29, +11, 32, 39.8, 5.23 },
-    { 13, 12, 32.90, +11, 33, 22.0, 5.77 },
-    {  9,  9, 46.39, +11, 33, 51.8, 6.48 },
-    {  9, 47, 25.90, +11, 34,  5.9, 6.45 },
-    { 19, 17, 49.01, +11, 35, 43.1, 5.28 },
-    { 22, 10, 37.39, +11, 37, 27.8, 5.78 },
-    {  8, 55, 55.61, +11, 37, 34.0, 5.41 },
-    { 19, 52,  3.50, +11, 37, 44.0, 6.13 },
-    { 14, 41, 43.49, +11, 39, 38.2, 5.56 },
-    {  7, 24, 58.20, +11, 40, 10.9, 5.30 },
-    {  6, 32, 23.30, +11, 40, 25.0, 6.03 },
-    {  6,  3, 24.70, +11, 40, 50.9, 6.08 },
-    { 22, 36, 36.41, +11, 41, 48.8, 6.40 },
-    {  4, 46,  1.70, +11, 42, 20.2, 5.37 },
-    { 10, 59, 41.09, +11, 42, 20.9, 6.55 },
-    {  8, 16, 33.91, +11, 43, 35.0, 7.13 },
-    { 22, 59, 11.81, +11, 43, 44.0, 5.75 },
-    {  6, 20, 52.30, +11, 45, 23.0, 6.54 },
-    {  5, 54, 32.21, +11, 45, 45.0, 6.59 },
-    {  6, 31, 39.19, +11, 47, 31.9, 6.65 },
-    {  9, 46, 23.30, +11, 48, 36.0, 5.63 },
-    {  8, 50, 26.10, +11, 48, 45.0,      },
-    { 19, 48, 42.10, +11, 48, 56.9, 5.72 },
-    { 19, 42, 34.01, +11, 49, 36.1, 5.27 },
-    { 22, 56, 51.50, +11, 50, 53.9, 6.51 },
-    {  8, 58, 29.21, +11, 51, 28.1, 4.25 },
-    {  3, 10, 38.90, +11, 52, 21.0, 5.98 },
-    {  6, 57, 25.70, +11, 54, 27.0, 6.27 },
-    { 17, 30, 22.39, +11, 55, 30.0, 6.39 },
-    { 17, 32, 15.00, +11, 55, 49.1, 6.42 },
-    { 19, 24, 58.20, +11, 56, 39.8, 5.16 },
-    { 17, 50, 43.49, +11, 56, 48.1, 6.17 },
-    { 12, 47, 13.61, +11, 57, 29.2, 6.07 },
-    { 10,  8, 22.30, +11, 58,  1.9, 1.35 },
-    {  0, 47,  1.51, +11, 58, 26.0, 5.50 },
-    { 11, 18, 21.00, +11, 59,  4.9, 6.66 },
-    { 18,  5, 43.30, +12,  0, 14.0, 7.04 },
-    {  7, 29, 47.81, +12,  0, 24.1, 4.54 },
-    { 18, 22, 35.30, +12,  1, 44.0, 5.89 },
-    { 15, 40, 10.39, +12,  3, 11.2, 6.25 },
-    { 21, 56, 56.40, +12,  4, 35.0, 5.54 },
-    {  8, 46, 55.99, +12,  6, 36.0, 5.87 },
-    {  7, 14, 32.59, +12,  6, 56.9, 5.62 },
-    { 21, 31,  9.60, +12,  8, 15.0, 6.08 },
-    {  1, 37,  5.90, +12,  8, 30.1, 5.57 },
-    { 13, 52, 18.41, +12,  9, 55.1, 6.04 },
-    { 22, 46, 41.59, +12, 10, 22.1, 4.19 },
-    { 19, 42, 12.79, +12, 11, 35.9, 6.34 },
-    {  4, 40,  3.41, +12, 11, 52.1, 5.46 },
-    { 22, 21, 31.10, +12, 12, 19.1, 5.01 },
-    {  6, 16, 26.59, +12, 16, 19.9, 5.04 },
-    { 11, 50, 55.30, +12, 16, 44.0, 6.35 },
-    {  1, 59, 25.90, +12, 17, 40.9, 6.09 },
-    { 23, 23,  4.61, +12, 18, 50.0, 5.08 },
-    { 19, 19, 39.31, +12, 22, 28.9, 5.53 },
-    { 16, 40, 51.41, +12, 23, 42.0, 6.08 },
-    { 12, 53, 49.70, +12, 25,  7.0, 6.25 },
-    { 13, 24, 30.50, +12, 25, 54.8, 6.44 },
-    {  9, 58, 13.39, +12, 26, 40.9, 5.26 },
-    {  2, 44, 57.60, +12, 26, 44.9, 5.18 },
-    {  2, 36, 37.90, +12, 26, 51.0, 5.68 },
-    { 17, 10, 45.79, +12, 28,  1.9, 6.57 },
-    {  4,  0, 40.80, +12, 29, 25.1, 3.47 },
-    {  4, 38,  9.50, +12, 30, 38.9, 4.27 },
-    { 20, 49, 37.80, +12, 32, 43.1, 5.98 },
-    {  6, 15, 45.00, +12, 33,  4.0, 5.33 },
-    { 17, 34, 56.11, +12, 33, 36.0, 2.08 },
-    { 15, 22, 23.21, +12, 34,  3.0, 6.28 },
-    { 20, 55, 38.59, +12, 34,  7.0, 5.58 },
-    {  6, 22, 36.50, +12, 34, 12.0, 6.00 },
-    { 22, 37,  4.70, +12, 34, 37.9, 6.30 },
-    {  7,  3, 51.60, +12, 35, 39.8, 5.98 },
-    {  3, 24, 10.10, +12, 37, 45.8, 6.04 },
-    {  5, 49, 32.90, +12, 39,  4.0, 4.91 },
-    {  8, 26, 43.90, +12, 39, 15.8, 5.50 },
-    {  8, 43, 12.31, +12, 40, 50.9, 5.64 },
-    {  6, 45, 54.19, +12, 41, 37.0, 6.46 },
-    {  3, 27, 18.70, +12, 44,  6.0, 6.28 },
-    { 17,  5, 22.70, +12, 44, 26.9, 4.91 },
-    {  4, 13, 49.90, +12, 45, 11.9, 6.25 },
-    { 23, 29,  9.31, +12, 45, 38.2, 4.55 },
-    {  5, 58, 53.21, +12, 48, 31.0, 5.70 },
-    { 11, 15, 57.79, +12, 50, 40.9, 6.67 },
-    { 15, 41, 47.40, +12, 50, 51.0, 5.33 },
-    {  7, 44, 13.99, +12, 51, 33.8, 6.43 },
-    {  6, 45, 17.40, +12, 53, 44.2, 3.36 },
-    {  3, 30, 52.39, +12, 56, 12.1, 4.11 },
-    {  1,  6, 33.60, +12, 57, 22.0, 6.12 },
-    { 14, 14,  5.21, +12, 57, 33.8, 5.54 },
-    {  6, 39, 47.59, +12, 58, 59.2, 5.97 },
-    { 14, 19, 16.30, +13,  0, 15.1, 5.41 },
-    { 19, 26, 24.10, +13,  1, 26.0, 5.74 },
-    { 20, 33, 57.00, +13,  1, 37.9, 5.38 },
-    {  3, 51, 15.79, +13,  2, 44.9, 6.30 },
-    {  4, 28, 50.21, +13,  2, 51.0, 5.03 },
-    {  3, 11, 21.91, +13,  2, 52.1, 6.12 },
-    {  8, 14, 21.00, +13,  2, 53.9, 6.38 },
-    {  9, 51,  1.99, +13,  3, 58.0, 6.46 },
-    { 18,  7, 48.41, +13,  4, 16.0, 6.63 },
-    {  8,  5,  4.51, +13,  7,  5.2, 5.12 },
-    { 22,  1,  5.40, +13,  7, 10.9, 5.60 },
-    {  6, 54, 38.69, +13, 10, 40.1, 4.65 },
-    {  3,  6, 23.71, +13, 11, 13.9, 5.62 },
-    { 15, 53, 12.10, +13, 11, 48.1, 6.10 },
-    {  0, 35, 54.70, +13, 12, 24.1, 6.41 },
-    { 20, 19, 29.21, +13, 13,   .8, 6.21 },
-    {  6, 43, 59.30, +13, 13, 40.1, 4.49 },
-    { 15,  8, 53.40, +13, 14,  6.0, 6.10 },
-    {  7, 59, 35.09, +13, 14, 31.9, 6.02 },
-    {  8, 33, 45.10, +13, 15, 25.9, 6.28 },
-    { 16, 49, 34.61, +13, 15, 41.0, 5.91 },
-    { 19, 44, 34.10, +13, 18, 10.1, 6.26 },
-    { 11, 15, 51.89, +13, 18, 27.0, 5.32 },
-    { 20, 38, 43.90, +13, 18, 54.0, 5.72 },
-    { 17, 38, 57.79, +13, 19, 45.1, 6.12 },
-    { 10, 11, 38.21, +13, 21, 18.0, 6.44 },
-    {  7, 49,  1.99, +13, 22, 14.9, 6.04 },
-    {  0, 34, 55.30, +13, 22, 16.0, 6.40 },
-    {  0,  5, 42.00, +13, 23, 46.0, 5.51 },
-    {  4,  9,  1.61, +13, 23, 53.9, 5.95 },
-    {  6, 50, 25.49, +13, 24, 47.9, 5.65 },
-    {  2,  2, 35.21, +13, 28, 36.1, 5.94 },
-    {  7, 41, 51.79, +13, 28, 50.2, 5.77 },
-    {  0, 22, 25.49, +13, 28, 57.0, 6.23 },
-    {  4, 56, 22.30, +13, 30, 51.8, 4.07 },
-    { 14, 40, 42.41, +13, 32,  3.1, 5.91 },
-    { 20, 20,   .19, +13, 32, 53.2, 5.95 },
-    { 12, 48, 14.30, +13, 33, 11.2, 6.56 },
-    { 17,  3, 58.01, +13, 34,  3.0, 6.08 },
-    { 16, 48,  8.90, +13, 35, 26.2, 6.35 },
-    { 17,  3, 39.31, +13, 36, 19.1, 5.93 },
-    { 16, 55, 16.01, +13, 37, 10.9, 6.34 },
-    { 18, 59,  5.69, +13, 37, 21.0, 5.23 },
-    {  6, 11, 27.89, +13, 38, 19.0, 6.04 },
-    {  8,  8, 42.41, +13, 38, 26.9, 6.27 },
-    { 15, 43, 10.61, +13, 40,  4.1, 6.48 },
-    { 13, 17, 15.60, +13, 40, 32.2, 5.33 },
-    {  5, 28, 34.80, +13, 40, 44.0, 6.35 },
-    { 16, 37, 48.00, +13, 41, 12.8, 6.31 },
-    {  0, 57, 54.50, +13, 41, 44.9, 6.32 },
-    { 20, 55, 36.70, +13, 43, 17.0, 5.17 },
-    {  4, 30, 37.30, +13, 43, 27.8, 5.40 },
-    { 10, 16, 40.70, +13, 43, 41.9, 5.41 },
-    { 14, 41,  8.90, +13, 43, 41.9, 4.83 },
-    { 14, 41,  8.90, +13, 43, 41.9, 4.43 },
-    {  7, 40, 47.30, +13, 46, 14.9, 6.24 },
-    { 18, 18,  2.90, +13, 46, 36.8, 6.30 },
-    { 13, 28, 25.80, +13, 46, 44.0, 4.98 },
-    { 15, 48, 13.30, +13, 47, 19.0, 6.00 },
-    { 19, 41,  5.50, +13, 48, 56.2, 6.01 },
-    {  6, 15,  8.50, +13, 51,  4.0, 5.91 },
-    { 19,  5, 24.60, +13, 51, 47.9, 2.99 },
-    {  4, 20, 52.80, +13, 51, 51.1, 6.17 },
-    { 16, 57, 31.99, +13, 53,  3.1, 6.37 },
-    {  5, 47, 42.89, +13, 53, 58.9, 5.29 },
-    { 18, 58, 46.90, +13, 54, 24.1, 5.89 },
-    {  5, 56,  3.50, +13, 55, 31.1, 6.60 },
-    { 18, 52,  1.90, +13, 57, 56.2, 6.14 },
-    {  8, 12, 22.10, +14,  0, 14.0, 6.54 },
-    {  9, 43, 43.90, +14,  1, 18.1, 5.35 },
-    { 16, 25, 25.01, +14,  1, 59.9, 4.57 },
-    {  4, 19, 57.70, +14,  2,  7.1, 5.59 },
-    { 13, 55, 49.99, +14,  3, 23.0, 6.16 },
-    {  6, 17, 33.29, +14,  3, 29.9, 6.59 },
-    {  4, 22,  3.50, +14,  4, 37.9, 5.72 },
-    { 17,  3,  7.80, +14,  5, 30.8, 4.98 },
-    { 15, 47, 17.30, +14,  6, 55.1, 5.71 },
-    { 12, 48, 54.19, +14,  7, 21.0, 5.70 },
-    { 10, 32, 11.81, +14,  8, 13.9, 5.46 },
-    {  6, 33, 36.10, +14,  9, 19.1, 5.53 },
-    {  5, 52, 22.30, +14, 10, 18.1, 5.59 },
-    { 10, 46, 25.30, +14, 11, 40.9, 5.48 },
-    {  7, 42,  3.19, +14, 12, 29.9, 5.56 },
-    {  6, 11, 56.40, +14, 12, 32.0, 4.48 },
-    {  8, 28, 37.30, +14, 12, 38.9, 5.95 },
-    {  4, 52, 31.99, +14, 15,  2.2, 4.74 },
-    { 19, 27, 33.89, +14, 16, 57.0, 6.32 },
-    { 11, 48, 38.71, +14, 17,  3.1, 5.88 },
-    { 18,  8, 33.70, +14, 17,  4.9, 6.37 },
-    { 17, 43, 22.01, +14, 17, 42.0, 6.24 },
-    { 13, 38,  7.90, +14, 18,  6.1, 6.52 },
-    {  5, 33, 54.29, +14, 18, 20.2, 5.64 },
-    {  5, 50, 28.90, +14, 18, 20.2, 5.52 },
-    { 11, 31, 44.90, +14, 21, 51.8, 6.20 },
-    {  9, 35, 52.90, +14, 22, 46.9, 6.36 },
-    {  6, 18,  5.59, +14, 22, 58.1, 6.16 },
-    { 17, 14, 39.19, +14, 23, 24.0, 5.39 },
-    { 17, 14, 38.90, +14, 23, 25.1, 3.48 },
-    { 19, 36, 15.79, +14, 23, 30.1, 6.38 },
-    { 11, 11, 43.70, +14, 24,  1.1, 6.30 },
-    { 17, 44, 17.30, +14, 24, 37.1, 6.19 },
-    { 15, 57, 14.59, +14, 24, 51.8, 5.54 },
-    { 14, 56, 13.20, +14, 26, 47.0, 5.77 },
-    {  5, 47, 13.20, +14, 29, 17.9, 5.72 },
-    { 17,  3, 10.39, +14, 30, 40.0, 6.52 },
-    { 22, 41, 57.41, +14, 30, 59.0, 5.90 },
-    {  4, 58, 59.40, +14, 32, 34.1, 6.09 },
-    { 19, 16, 26.81, +14, 32, 40.9, 5.63 },
-    { 22, 40, 52.70, +14, 32, 57.8, 5.71 },
-    { 20, 22, 52.30, +14, 33,  5.0, 6.17 },
-    { 20, 20, 20.50, +14, 34,  9.1, 6.13 },
-    { 11, 49,  3.60, +14, 34, 18.8, 2.14 },
-    { 20, 41, 16.20, +14, 34, 59.2, 5.99 },
-    { 20, 37, 33.00, +14, 35, 43.1, 3.63 },
-    { 19, 29, 22.10, +14, 35, 44.9, 5.56 },
-    {  8, 10, 58.80, +14, 37, 45.8, 6.23 },
-    { 22, 10, 22.20, +14, 37, 48.0, 6.33 },
-    { 13, 58, 39.89, +14, 38, 57.8, 6.00 },
-    {  6, 20,  4.20, +14, 39,  4.0, 5.69 },
-    {  1, 35, 46.39, +14, 39, 41.0, 6.22 },
-    { 20, 35, 18.50, +14, 40, 27.1, 4.68 },
-    {  4, 26, 36.41, +14, 42, 49.0, 4.69 },
-    {  6, 25, 28.10, +14, 43, 18.8, 6.24 },
-    { 21,  3,  1.80, +14, 43, 48.0, 6.31 },
-    {  4, 28, 23.40, +14, 44, 26.9, 5.90 },
-    {  6,  7, 34.30, +14, 46,  5.9, 4.42 },
-    { 21, 44, 31.30, +14, 46, 18.8, 5.94 },
-    { 17, 33, 42.79, +14, 50, 30.1, 6.48 },
-    {  4, 33, 50.90, +14, 50, 39.8, 4.65 },
-    { 12, 16,   .19, +14, 53, 56.0, 5.10 },
-    { 19, 23,  8.21, +14, 55, 16.0, 6.64 },
-    {  9, 15, 13.80, +14, 56, 29.0, 5.34 },
-    {  1,  5,  5.40, +14, 56, 46.0, 5.68 },
-    { 17,  1, 33.00, +14, 56, 57.8, 6.31 },
-    { 18, 25, 55.39, +14, 58,   .1, 6.37 },
-    { 16, 52,  4.90, +14, 58, 27.1, 6.52 },
-    { 10, 21, 50.30, +14, 58, 32.2, 6.12 },
-    {  9, 12, 17.59, +14, 59, 46.0, 6.51 },
-    {  2, 32, 54.10, +15,  2,  4.9, 6.04 },
-    {  4, 55, 50.30, +15,  2, 24.0, 5.81 },
-    { 18, 59, 37.39, +15,  4,  5.9, 4.02 },
-    { 20, 43, 27.50, +15,  4, 27.8, 4.43 },
-    {  2, 51, 29.59, +15,  4, 54.8, 5.49 },
-    { 19, 15, 20.09, +15,  5,  1.0, 5.57 },
-    { 18,  0, 57.19, +15,  5, 35.9, 6.26 },
-    {  4, 20, 36.31, +15,  5, 43.1, 5.26 },
-    {  7, 28, 47.30, +15,  6, 33.8, 6.22 },
-    { 14, 46,  6.00, +15,  7, 54.8, 5.63 },
-    { 15, 50, 41.71, +15,  8,  1.0, 5.20 },
-    {  7, 20,  6.89, +15,  8, 34.1, 6.45 },
-    { 12, 17, 44.30, +15,  8, 39.1, 6.34 },
-    {  4,  7, 42.00, +15,  9, 46.1, 6.01 },
-    { 17, 41, 10.99, +15, 10, 41.2, 6.34 },
-    {  0, 13, 14.21, +15, 11,  1.0, 2.83 },
-    { 20, 14, 16.61, +15, 11, 51.0, 4.95 },
-    { 23,  4, 45.70, +15, 12, 19.1, 2.49 },
-    {  0, 36, 47.30, +15, 13, 54.1, 5.89 },
-    {  5, 27, 13.80, +15, 15, 28.1, 6.16 },
-    { 14, 17, 28.39, +15, 15, 47.9, 5.80 },
-    {  2, 13,  3.29, +15, 16, 46.9, 5.71 },
-    {  2, 44, 32.90, +15, 18, 42.1, 5.77 },
-    {  8, 36,  7.70, +15, 18, 49.0, 6.32 },
-    {  8, 57, 14.90, +15, 19, 22.1, 5.20 },
-    { 17, 51, 58.49, +15, 19, 32.9, 6.46 },
-    {  7,  2, 17.40, +15, 20, 10.0, 5.74 },
-    {  1, 31, 28.99, +15, 20, 44.9, 3.62 },
-    {  8, 51,  1.51, +15, 21,  2.2, 6.38 },
-    {  5, 30, 26.09, +15, 21, 37.1, 5.94 },
-    {  9, 21, 15.41, +15, 22, 16.0, 6.53 },
-    {  4, 15, 46.30, +15, 24,  2.2, 6.32 },
-    {  5,  4, 34.10, +15, 24, 15.1, 4.68 },
-    { 11, 29, 41.90, +15, 24, 47.9, 5.74 },
-    { 15, 46, 11.30, +15, 25, 18.8, 3.67 },
-    { 15, 25, 47.40, +15, 25, 41.2, 5.17 },
-    { 11, 14, 14.40, +15, 25, 45.8, 3.34 },
-    {  3, 37, 47.81, +15, 25, 50.9, 6.39 },
-    {  0, 46, 33.00, +15, 28, 32.2, 5.38 },
-    { 16, 36, 43.01, +15, 29, 53.2, 6.30 },
-    { 20,  5, 26.50, +15, 30,  1.1, 6.34 },
-    {  7, 24, 27.70, +15, 31,  1.9, 6.41 },
-    {  8, 57, 35.21, +15, 34, 53.0, 5.67 },
-    {  5,  9, 42.00, +15, 35, 49.9, 4.82 },
-    { 17, 24, 33.79, +15, 36, 22.0, 6.35 },
-    {  4, 26, 20.81, +15, 37,  5.9, 4.49 },
-    {  4, 19, 47.59, +15, 37, 39.0, 3.65 },
-    {  4, 30,  8.59, +15, 38, 17.2, 5.58 },
-    { 11, 55, 40.49, +15, 38, 48.1, 5.53 },
-    { 21,  7, 33.60, +15, 39, 31.0, 6.34 },
-    { 15, 56, 27.19, +15, 39, 42.1, 3.85 },
-    {  1, 10, 11.50, +15, 40, 27.1, 6.06 },
-    {  4, 30, 38.90, +15, 41, 30.8, 5.48 },
-    { 14, 53, 23.30, +15, 42, 15.8, 6.40 },
-    { 16, 45, 22.51, +15, 44, 43.1, 5.56 },
-    { 10,  5, 40.90, +15, 45, 27.0, 6.37 },
-    {  7, 56, 59.40, +15, 47, 25.1, 5.78 },
-    { 13, 49, 28.61, +15, 47, 52.1, 4.07 },
-    {  4, 39,  9.19, +15, 47, 58.9, 5.07 },
-    {  5, 46, 45.50, +15, 49, 21.0, 6.00 },
-    {  7, 33, 36.50, +15, 49, 36.1, 5.25 },
-    { 20, 39,  4.99, +15, 50, 17.2, 5.97 },
-    {  4, 31, 51.79, +15, 51,  6.1, 6.02 },
-    {  3,  4, 40.70, +15, 51, 22.0, 6.49 },
-    { 22, 32, 46.90, +15, 51, 47.9, 6.32 },
-    {  4, 28, 39.70, +15, 52, 14.9, 3.40 },
-    {  5, 27, 45.60, +15, 52, 27.1, 5.50 },
-    {  6, 31, 37.39, +15, 54, 11.9, 6.40 },
-    {  4, 49, 44.09, +15, 54, 15.1, 6.08 },
-    { 20, 39, 38.30, +15, 54, 42.8, 3.77 },
-    {  4, 39, 16.49, +15, 55,  5.2, 4.69 },
-    {  7,  8, 22.01, +15, 55, 50.9, 5.44 },
-    {  4, 25, 37.30, +15, 56, 26.9, 6.46 },
-    { 17, 41, 58.70, +15, 57,  6.8, 5.52 },
-    {  4, 28, 34.51, +15, 57, 43.9, 3.84 },
-    { 21, 13, 28.80, +15, 58, 57.0, 6.27 },
-    { 15, 40, 59.21, +16,  1, 28.9, 6.01 },
-    { 20,  3, 30.00, +16,  1, 53.0, 5.67 },
-    {  4, 38,  9.41, +16,  1, 59.9, 5.79 },
-    { 22, 11, 51.29, +16,  2, 26.2, 5.95 },
-    {  5, 11, 41.59, +16,  2, 44.2, 5.18 },
-    { 15, 32,  9.70, +16,  3, 22.0, 6.22 },
-    {  6, 24, 52.90, +16,  3, 24.8, 6.33 },
-    { 15, 53, 34.90, +16,  4, 30.0, 6.09 },
-    {  7,  0, 15.79, +16,  4, 44.0, 5.68 },
-    { 15, 36, 29.30, +16,  7,  8.0, 5.93 },
-    { 12, 52, 27.60, +16,  7, 21.0, 6.30 },
-    { 20, 46, 39.50, +16,  7, 27.1, 4.27 },
-    { 20, 46, 38.71, +16,  7, 27.8, 5.14 },
-    {  6, 12,  3.29, +16,  7, 50.2, 4.95 },
-    {  1, 14,  7.61, +16,  8,  1.0, 5.98 },
-    {  6, 15, 25.10, +16,  8, 35.2, 5.30 },
-    {  7, 13, 22.30, +16,  9, 32.0, 5.00 },
-    {  4, 30, 33.70, +16, 11, 38.0, 4.78 },
-    { 18, 37,  9.00, +16, 11, 53.9, 6.29 },
-    {  6, 49, 49.80, +16, 12, 10.1, 5.85 },
-    {  6, 28, 28.01, +16, 14, 17.9, 6.23 },
-    { 11, 49, 14.90, +16, 14, 34.1, 6.04 },
-    { 17, 24, 31.51, +16, 18,  4.0, 5.71 },
-    { 14, 19, 45.19, +16, 18, 24.8, 4.86 },
-    { 17, 33, 39.41, +16, 19,  3.0, 5.69 },
-    {  4, 28, 26.40, +16, 21, 34.9, 4.97 },
-    { 14, 57, 11.71, +16, 23, 17.9, 5.71 },
-    {  6, 41, 21.79, +16, 23, 51.0, 6.28 },
-    {  6, 37, 42.70, +16, 23, 57.1, 1.93 },
-    {  1, 39, 40.80, +16, 24, 20.9, 5.97 },
-    { 14, 40, 43.90, +16, 25,  4.1, 5.88 },
-    { 14, 40, 43.61, +16, 25,  5.9, 4.94 },
-    {  9, 37,  2.59, +16, 26, 16.1, 5.69 },
-    {  0, 28, 12.70, +16, 26, 42.0, 6.06 },
-    {  8,  1, 30.31, +16, 27, 19.1, 5.99 },
-    { 11, 25, 36.41, +16, 27, 23.0, 5.57 },
-    { 19, 37, 17.40, +16, 27, 46.1, 5.66 },
-    { 18, 10,  8.71, +16, 28, 36.1, 6.09 },
-    {  2, 53, 11.71, +16, 28, 59.9, 6.31 },
-    { 17, 34, 27.19, +16, 30, 14.0, 6.40 },
-    {  4, 35, 55.20, +16, 30, 33.1, 0.85 },
-    {  8, 12, 59.81, +16, 30, 51.1, 6.01 },
-    {  7, 58, 31.49, +16, 31,  7.0, 5.99 },
-    {  5, 41, 17.71, +16, 32,  2.0, 4.86 },
-    {  3, 39, 25.70, +16, 32, 12.1, 6.16 },
-    {  7, 18,  5.59, +16, 32, 25.1, 3.58 },
-    { 23,  5,  6.29, +16, 33, 47.2, 6.44 },
-    { 19, 39, 25.39, +16, 34, 17.0, 6.38 },
-    { 12, 46, 38.71, +16, 34, 39.0, 5.12 },
-    {  9, 25, 32.50, +16, 35,  8.2, 6.29 },
-    { 19, 56,  1.30, +16, 38,  4.9, 5.36 },
-    { 20,  8,  6.50, +16, 39, 51.1, 6.42 },
-    { 16, 11, 28.70, +16, 39, 56.2, 6.08 },
-    {  7,  2, 33.50, +16, 40, 27.1, 5.82 },
-    { 18, 23,  2.90, +16, 41, 17.2, 6.22 },
-    {  5, 23, 37.70, +16, 41, 57.8, 6.08 },
-    {  5, 26,  5.71, +16, 42,  1.1, 6.25 },
-    { 17, 21, 33.41, +16, 43, 50.9, 6.35 },
-    { 18,  0,  3.41, +16, 45,  2.9, 4.67 },
-    { 10,  7, 19.99, +16, 45, 46.1, 3.52 },
-    {  4, 23, 25.01, +16, 46, 37.9, 5.64 },
-    { 19, 57, 45.41, +16, 47, 21.1, 5.53 },
-    { 11, 34, 42.50, +16, 47, 48.8, 5.95 },
-    { 12, 10, 31.61, +16, 48, 33.1, 6.39 },
-    { 20, 59, 50.81, +16, 49, 27.1, 6.66 },
-    { 23, 37, 39.79, +16, 49, 32.2, 6.26 },
-    { 22, 53,  2.30, +16, 50, 28.0, 5.64 },
-    { 19, 12, 34.39, +16, 50, 47.0, 6.73 },
-    { 13,  9, 47.81, +16, 50, 55.0, 5.91 },
-    { 19,  8, 40.20, +16, 51,  5.0, 6.48 },
-    { 19,  7, 57.29, +16, 51, 11.9, 6.07 },
-    { 17, 25, 54.41, +16, 55,  3.0, 5.98 },
-    { 18, 31,  4.39, +16, 55, 43.0, 5.77 },
-    { 19, 24, 22.10, +16, 56, 16.1, 6.25 },
-    {  6, 31, 10.10, +16, 56, 19.0, 6.20 },
-    {  0, 48, 58.70, +16, 56, 26.2, 5.07 },
-    { 22, 54, 35.69, +16, 56, 30.1, 6.12 },
-    {  1, 48, 10.90, +16, 57, 20.2, 5.84 },
-    { 14, 45, 14.50, +16, 57, 51.8, 4.60 },
-    { 18, 35, 53.21, +16, 58, 32.2, 6.21 },
-    {  5, 37,  3.79, +17,  2, 25.1, 5.54 },
-    {  8, 25, 49.90, +17,  2, 46.0, 6.14 },
-    { 16,  8,  4.51, +17,  2, 48.8, 5.00 },
-    { 16,  8,  4.90, +17,  3, 15.8, 6.25 },
-    { 16, 35, 26.30, +17,  3, 25.9, 6.41 },
-    {  5, 32, 14.21, +17,  3, 29.2, 5.46 },
-    { 20,  4,  6.19, +17,  4, 12.0, 5.80 },
-    { 12, 52, 12.31, +17,  4, 26.0, 6.32 },
-    {  7, 31, 48.41, +17,  5, 10.0, 5.42 },
-    { 12, 36, 58.30, +17,  5, 21.8, 5.68 },
-    { 13,  1,  9.60, +17,  7, 23.2, 5.96 },
-    { 15, 33, 52.80, +17,  8, 16.1, 6.45 },
-    {  8, 57,  8.21, +17,  8, 38.0, 6.17 },
-    {  4, 57, 22.30, +17,  9, 13.0, 5.48 },
-    {  6, 16, 23.81, +17, 10, 53.0, 6.39 },
-    { 21, 47,  4.70, +17, 11, 39.1, 6.21 },
-    { 16,  8, 46.61, +17, 12, 20.9, 6.14 },
-    {  2,  9, 23.09, +17, 13, 27.8, 6.43 },
-    {  8, 55, 22.90, +17, 13, 53.0, 6.64 },
-    {  5, 28,  1.61, +17, 14, 20.0, 5.77 },
-    { 15, 44, 42.10, +17, 15, 51.1, 6.14 },
-    {  4, 12, 31.39, +17, 16, 39.0, 6.09 },
-    { 21, 50,  8.71, +17, 17,  8.2, 5.29 },
-    {  4,  0, 36.91, +17, 17, 48.1, 6.32 },
-    {  8,  0, 47.30, +17, 18, 31.0, 5.55 },
-    { 20, 26, 23.21, +17, 18, 56.2, 6.22 },
-    { 17, 18,  4.99, +17, 19,  5.2, 6.00 },
-    {  6, 19,  1.80, +17, 19, 30.0, 6.32 },
-    {  3, 53, 10.01, +17, 19, 36.8, 5.97 },
-    {  4,  7, 59.40, +17, 20, 22.9, 5.89 },
-    { 21, 44, 30.70, +17, 21,   .0, 4.34 },
-    { 18, 58, 14.69, +17, 21, 38.9, 5.38 },
-    {  5, 24, 25.39, +17, 22, 59.9, 4.99 },
-    { 15, 52, 56.21, +17, 24, 13.0, 6.36 },
-    { 12, 58, 55.39, +17, 24, 33.8, 4.78 },
-    {  1, 46, 35.30, +17, 24, 47.2, 6.55 },
-    {  1, 35, 54.79, +17, 26,  1.0, 5.80 },
-    {  4, 24,  5.81, +17, 26, 38.0, 4.80 },
-    { 13, 47, 15.70, +17, 27, 24.1, 4.50 },
-    {  2, 49, 17.50, +17, 27, 51.1, 5.22 },
-    { 19, 41,  2.90, +17, 28, 34.0, 4.37 },
-    { 20,  0,  3.31, +17, 31,   .1, 5.37 },
-    { 20, 41, 58.20, +17, 31, 17.0, 6.22 },
-    { 13,  9, 59.30, +17, 31, 45.8, 5.22 },
-    { 13,  9, 59.30, +17, 31, 45.8, 5.22 },
-    {  4, 22, 56.09, +17, 32, 33.0, 3.76 },
-    { 23, 10, 42.60, +17, 35, 39.8, 5.71 },
-    {  6, 42, 24.29, +17, 38, 43.1, 5.21 },
-    {  8, 12, 12.70, +17, 38, 52.1, 6.02 },
-    {  8, 12, 12.70, +17, 38, 52.1, 5.63 },
-    {  8, 12, 13.30, +17, 38, 52.1, 6.20 },
-    { 15, 35, 33.19, +17, 39, 20.2, 6.12 },
-    {  7, 39, 28.61, +17, 40, 28.9, 5.05 },
-    {  8, 14, 11.09, +17, 40, 32.9, 6.47 },
-    { 17, 47,  7.99, +17, 41, 49.9, 5.72 },
-    {  2, 30, 54.41, +17, 42, 14.0, 6.23 },
-    {  5, 47, 26.21, +17, 43, 45.1, 5.49 },
-    { 10, 16, 16.10, +17, 44, 25.1, 6.55 },
-    {  7,  2, 25.49, +17, 45, 20.2, 5.94 },
-    {  6, 21, 25.90, +17, 45, 49.0, 6.35 },
-    {  2, 44, 19.10, +17, 45, 50.0, 6.46 },
-    { 12, 20, 43.01, +17, 47, 34.1, 4.74 },
-    { 20, 20, 21.41, +17, 47, 35.2, 5.80 },
-    {  1, 57, 21.10, +17, 49,  3.0, 5.10 },
-    { 16,  1, 14.30, +17, 49,  5.9, 5.12 },
-    { 18, 22, 49.01, +17, 49, 36.1, 5.25 },
-    {  3, 34,  8.30, +17, 49, 58.1, 6.17 },
-    {  3,  7, 25.70, +17, 52, 48.0, 6.11 },
-    {  0, 28,  2.90, +17, 53, 35.2, 5.06 },
-    { 21, 28, 59.90, +17, 54, 20.9, 6.44 },
-    {  6, 14, 28.61, +17, 54, 23.0, 5.88 },
-    {  4, 25, 29.40, +17, 55, 41.2, 4.29 },
-    { 13, 53, 12.91, +17, 55, 58.1, 5.70 },
-    {  5, 27, 10.10, +17, 57, 43.9, 5.42 },
-    { 18, 56,  3.89, +17, 59, 42.0, 6.63 },
-    { 22,  7, 30.00, +18,  0,  2.2, 6.35 },
-    { 19, 40,  5.81, +18,  0, 50.0, 4.37 },
-    {  4, 33, 32.90, +18,  1,   .1, 6.25 },
-    {  2, 56, 26.09, +18,  1, 23.2, 5.63 },
-    { 20, 50, 37.01, +18,  3,  5.0, 6.52 },
-    { 17, 20, 18.89, +18,  3, 25.9, 5.00 },
-    { 20, 45, 28.20, +18,  5, 25.1, 6.38 },
-    {  8, 31, 35.71, +18,  5, 39.8, 5.35 },
-    { 18, 56,  6.19, +18,  6, 19.1, 5.69 },
-    {  6, 11,  1.80, +18,  7, 45.8, 6.33 },
-    { 18, 18,  7.70, +18,  7, 53.0, 5.99 },
-    {  8, 59, 10.80, +18,  8,  4.9, 6.38 },
-    { 15, 48, 44.40, +18,  8, 30.1, 4.09 },
-    {  8, 44, 41.09, +18,  9, 15.1, 3.94 },
-    { 18, 47,  1.30, +18, 10, 53.0, 4.36 },
-    {  6, 47, 23.50, +18, 11, 35.9, 6.20 },
-    {  4,  0, 48.79, +18, 11, 38.0, 5.89 },
-    { 18, 35, 12.60, +18, 12, 11.9, 5.78 },
-    {  0,  9,  2.40, +18, 12, 42.8, 5.53 },
-    {  2,  3, 42.60, +18, 15, 11.9, 6.21 },
-    { 13, 39,  2.30, +18, 15, 55.1, 6.48 },
-    { 20, 37, 54.60, +18, 16,  9.1, 6.25 },
-    {  2, 48, 32.11, +18, 17,  1.0, 5.82 },
-    { 14, 38, 13.99, +18, 17, 53.9, 5.91 },
-    {  2, 55, 48.50, +18, 19, 54.1, 5.91 },
-    {  8, 23, 21.79, +18, 19, 55.9, 5.95 },
-    {  1, 29, 52.90, +18, 21, 20.2, 6.02 },
-    { 13,  0, 38.81, +18, 22, 23.2, 6.20 },
-    { 12, 35,  7.80, +18, 22, 36.8, 5.02 },
-    { 12, 35,  6.29, +18, 22, 37.9, 6.56 },
-    { 13, 54, 41.09, +18, 23, 52.1, 2.68 },
-    { 23, 37, 56.81, +18, 24,  2.2, 5.53 },
-    { 11, 30, 28.99, +18, 24, 34.9, 5.52 },
-    { 16, 55, 22.20, +18, 25, 59.9, 5.35 },
-    { 15,  7, 20.40, +18, 26, 30.1, 6.02 },
-    { 22, 25, 40.70, +18, 26, 39.8, 6.26 },
-    {  1, 34, 49.10, +18, 27, 38.2, 5.89 },
-    { 15, 41, 54.70, +18, 27, 50.0, 5.81 },
-    { 20,  3, 16.39, +18, 30,  2.2, 5.96 },
-    {  7, 46,  7.39, +18, 30, 36.0, 4.88 },
-    { 23,  6, 18.19, +18, 31,  3.0, 6.13 },
-    { 19, 47, 23.30, +18, 32,  3.1, 3.82 },
-    {  5, 33, 31.61, +18, 32, 25.1, 5.69 },
-    {  5, 32, 12.79, +18, 35, 39.8, 4.38 },
-    { 15, 55, 39.79, +18, 37, 14.2, 6.26 },
-    {  5,  7, 27.00, +18, 38, 42.0, 5.00 },
-    { 19, 52, 21.79, +18, 40, 18.8, 6.23 },
-    {  6, 13, 33.41, +18, 40, 49.1, 6.58 },
-    { 18, 46, 41.40, +18, 42, 20.9, 6.17 },
-    { 13, 13, 12.41, +18, 43, 36.8, 6.11 },
-    {  4, 46, 16.80, +18, 44,  6.0, 6.01 },
-    {  4, 20, 25.10, +18, 44, 33.0, 6.12 },
-    { 13, 12, 35.90, +18, 45,  6.1, 6.53 },
-    {  3, 27,  3.19, +18, 45, 23.0, 6.57 },
-    {  3,  8, 21.19, +18, 47, 42.0, 6.27 },
-    { 16, 15, 28.70, +18, 48, 29.9, 5.69 },
-    {  8, 50, 45.10, +18, 49, 55.9, 6.16 },
-    {  4, 51, 22.51, +18, 50, 22.9, 5.10 },
-    {  8,  4, 45.19, +18, 50, 31.9, 6.15 },
-    {  9, 44, 30.00, +18, 51, 49.0, 6.50 },
-    { 14, 45, 20.69, +18, 53,  4.9, 6.13 },
-    { 10, 46, 24.50, +18, 53, 29.0, 5.49 },
-    { 16, 25, 47.69, +18, 53, 33.0, 6.70 },
-    { 14, 16,  4.20, +18, 54, 42.8, 5.98 },
-    { 15, 12,  4.30, +18, 58, 32.9, 5.89 },
-    {  4, 24, 57.10, +19,  2, 30.1, 5.98 },
-    { 13, 16, 14.30, +19,  3,  6.1, 6.45 },
-    { 14, 51, 23.30, +19,  6,  4.0, 4.55 },
-    { 23, 52, 29.30, +19,  7, 13.1, 5.08 },
-    { 22, 50, 39.10, +19,  8, 26.9, 6.40 },
-    { 19, 48, 58.70, +19,  8, 31.9, 5.00 },
-    { 14, 53, 23.71, +19,  9, 10.1, 6.01 },
-    { 16, 21, 55.20, +19,  9, 11.2, 3.75 },
-    {  6, 14, 50.90, +19,  9, 23.0, 5.20 },
-    {  1, 26, 15.29, +19, 10, 19.9, 5.38 },
-    {  4, 28, 37.01, +19, 10, 49.1, 3.53 },
-    { 14, 15, 39.70, +19, 10, 57.0,-0.04 },
-    {  0, 54, 35.21, +19, 11, 17.9, 5.74 },
-    { 14, 26, 27.41, +19, 13, 36.8, 5.39 },
-    {  1, 26, 41.69, +19, 14, 25.1, 5.50 },
-    { 17, 48, 47.90, +19, 15, 19.1, 6.12 },
-    { 17, 33, 22.80, +19, 15, 24.1, 5.64 },
-    { 15, 12, 43.49, +19, 17,  8.9, 6.68 },
-    {  1, 53, 31.80, +19, 17, 37.0, 4.75 },
-    {  1, 53, 31.80, +19, 17, 44.9, 4.83 },
-    { 19,  1,  5.50, +19, 18, 34.9, 6.39 },
-    { 21, 37, 45.41, +19, 19,  7.0, 5.45 },
-    {  7, 51, 56.71, +19, 19, 31.1, 5.99 },
-    { 18, 48, 53.40, +19, 19, 43.0, 5.88 },
-    { 21,  0, 27.70, +19, 19, 45.8, 5.65 },
-    { 10, 27,   .50, +19, 21, 51.8, 6.15 },
-    { 22, 45, 28.20, +19, 22,   .1, 6.25 },
-    { 21, 26, 26.69, +19, 22, 32.2, 6.07 },
-    { 10, 19, 44.09, +19, 28, 14.9, 4.79 },
-    { 22,  7, 28.61, +19, 28, 32.2, 5.75 },
-    { 15, 25, 53.30, +19, 28, 50.9, 6.27 },
-    {  4, 54, 58.30, +19, 29,  7.1, 6.37 },
-    { 19, 58, 45.41, +19, 29, 31.9, 3.47 },
-    {  2, 10, 37.61, +19, 30,  1.1, 5.70 },
-    { 18,  0, 27.70, +19, 30, 20.9, 6.50 },
-    { 22, 38, 52.61, +19, 31, 19.9, 5.82 },
-    {  8, 40, 27.00, +19, 32, 42.0, 6.30 },
-    {  0, 47, 13.61, +19, 34, 44.0, 6.13 },
-    {  8, 35, 19.39, +19, 35, 24.0, 6.58 },
-    { 17,  4, 41.30, +19, 35, 57.1, 6.17 },
-    {  4,  9, 10.01, +19, 36, 33.1, 5.50 },
-    { 19, 18, 48.50, +19, 36, 38.2, 6.58 },
-    { 18,  3, 14.69, +19, 36, 47.2, 6.50 },
-    { 22, 10, 19.01, +19, 37,   .8, 6.18 },
-    {  1,  9, 49.20, +19, 39, 31.0, 5.55 },
-    { 19,  2, 52.61, +19, 39, 40.0, 6.09 },
-    {  3, 43, 47.21, +19, 39, 54.0, 6.14 },
-    { 21, 53, 37.39, +19, 40,  5.9, 5.68 },
-    {  8, 40, 22.10, +19, 40, 12.0, 6.44 },
-    { 15, 41, 33.10, +19, 40, 13.1, 4.52 },
-    { 22, 39, 46.99, +19, 40, 52.0, 6.21 },
-    { 17,  3, 52.70, +19, 41, 26.2, 6.35 },
-    {  6,  3, 27.29, +19, 41, 26.2, 5.14 },
-    {  3, 42, 18.91, +19, 42,  1.1, 5.69 },
-    { 21, 54, 17.40, +19, 43,  5.9, 6.39 },
-    {  3, 11, 37.80, +19, 43, 36.1, 4.35 },
-    {  5, 54, 56.71, +19, 44, 58.9, 5.92 },
-    { 10, 44, 14.50, +19, 45, 31.0, 6.27 },
-    { 19, 34, 34.90, +19, 46, 23.9, 5.00 },
-    { 13, 16, 32.30, +19, 47,  7.1, 6.45 },
-    {  6, 12,  1.30, +19, 47, 26.2, 5.75 },
-    { 18, 58, 45.10, +19, 47, 39.1, 6.50 },
-    { 19, 25, 28.61, +19, 47, 55.0, 5.16 },
-    { 21, 22,  5.21, +19, 48, 15.8, 4.08 },
-    {  5,  5, 32.11, +19, 48, 23.0, 6.44 },
-    {  5, 20, 56.59, +19, 48, 51.1, 6.18 },
-    {  8,  0, 48.00, +19, 48, 58.0, 6.25 },
-    { 21, 51, 34.20, +19, 49, 36.1, 5.77 },
-    { 10, 19, 58.61, +19, 50, 26.2, 3.80 },
-    { 10, 19, 58.30, +19, 50, 30.1, 2.61 },
-    {  2, 30, 38.40, +19, 51, 19.1, 6.15 },
-    { 20, 26,  1.20, +19, 51, 54.0, 6.41 },
-    {  5, 52, 23.40, +19, 52,  5.2, 6.06 },
-    {  4, 35, 42.70, +19, 52, 54.1, 6.36 },
-    {  7, 55, 39.91, +19, 53,  2.0, 5.35 },
-    { 19, 26, 28.70, +19, 53, 29.0, 5.81 },
-    {  2, 18,  7.49, +19, 54,  4.0, 5.62 },
-    { 23,  6, 31.90, +19, 54, 38.9, 6.30 },
-    { 20, 40, 45.19, +19, 56,  7.1, 6.45 },
-    { 13, 40, 40.49, +19, 57, 20.2, 5.75 },
-    { 20,  5,  9.50, +19, 59, 28.0, 5.10 },
-    {  8, 40,  6.41, +20,  0, 28.1, 6.39 },
-    {  2, 42, 22.01, +20,  0, 42.1, 5.69 },
-    { 18,  8, 52.90, +20,  2, 43.1, 5.10 },
-    { 17, 26, 49.10, +20,  4, 50.9, 5.54 },
-    {  1, 44, 55.80, +20,  4, 59.2, 6.27 },
-    { 20, 29, 21.10, +20,  5, 16.1, 6.55 },
-    { 19, 26, 13.20, +20,  5, 52.1, 5.63 },
-    { 14, 16, 32.81, +20,  7, 17.0, 6.25 },
-    {  5, 19, 14.69, +20,  8,  4.9, 6.08 },
-    {  6,  3, 55.20, +20,  8, 17.9, 4.63 },
-    {  5, 55, 49.30, +20, 10, 30.0, 5.40 },
-    { 11,  2, 19.80, +20, 10, 46.9, 4.42 },
-    { 19, 15,  2.59, +20, 12, 11.9, 6.00 },
-    {  0, 14, 36.19, +20, 12, 24.1, 4.80 },
-    {  6, 28, 57.79, +20, 12, 43.9, 4.15 },
-    { 11, 47, 59.09, +20, 13,  8.0, 4.53 },
-    { 22, 32, 35.50, +20, 13, 48.0, 6.42 },
-    {  7, 26, 56.30, +20, 15, 25.9, 5.93 },
-    { 19, 23, 46.90, +20, 15, 51.8, 6.40 },
-    { 21, 39,  1.10, +20, 15, 55.1, 5.85 },
-    {  1, 42, 29.81, +20, 16,  7.0, 5.24 },
-    { 19, 25, 22.39, +20, 16, 17.0, 6.31 },
-    {  5, 54, 22.90, +20, 16, 34.0, 4.41 },
-    { 19, 29, 20.90, +20, 16, 46.9, 6.33 },
-    {  0, 32, 35.50, +20, 17, 39.8, 5.38 },
-    {  5, 53, 19.10, +20, 17, 57.1, 6.71 },
-    { 15, 54, 34.61, +20, 18, 38.9, 5.44 },
-    {  7, 45,  9.29, +20, 18, 59.0, 6.33 },
-    { 19, 36, 37.70, +20, 19, 58.1, 7.14 },
-    {  5,  7, 48.41, +20, 25,  5.9, 5.30 },
-    {  8, 32, 42.50, +20, 26, 28.0, 5.33 },
-    { 11, 35,  3.79, +20, 26, 29.0, 6.45 },
-    {  7, 21, 56.81, +20, 26, 37.0, 5.10 },
-    { 21, 49, 26.90, +20, 27, 45.0, 6.29 },
-    { 18, 34, 19.61, +20, 27, 59.0, 6.57 },
-    {  1, 23, 24.91, +20, 28,  8.0, 5.97 },
-    {  5, 33, 38.81, +20, 28, 27.1, 6.18 },
-    { 19, 40, 28.30, +20, 28, 36.1, 6.50 },
-    { 16, 30, 33.60, +20, 28, 45.1, 5.25 },
-    {  6, 27, 56.59, +20, 29, 46.0, 6.22 },
-    { 11, 14,  6.50, +20, 31, 25.0, 2.56 },
-    { 12, 12,  9.31, +20, 32, 30.8, 5.57 },
-    { 18, 45, 39.70, +20, 32, 47.0, 4.19 },
-    { 17, 48, 24.79, +20, 33, 56.2, 5.69 },
-    {  7,  4,  6.50, +20, 34, 13.1, 3.79 },
-    { 15, 18, 24.50, +20, 34, 22.1, 5.70 },
-    {  4, 17, 15.60, +20, 34, 43.0, 4.94 },
-    { 20, 30, 58.10, +20, 36, 20.9, 6.18 },
-    {  2, 58,  5.21, +20, 40,  7.0, 5.80 },
-    {  4, 38, 15.79, +20, 41,  4.9, 5.92 },
-    {  5, 45, 39.41, +20, 41, 42.0, 6.95 },
-    {  1,  7, 57.19, +20, 44, 21.1, 5.55 },
-    {  3, 22, 45.19, +20, 44, 30.8, 5.09 },
-    {  8, 20, 21.00, +20, 44, 52.1, 5.83 },
-    { 22, 57, 27.89, +20, 46,  8.0, 5.49 },
-    { 19, 38, 17.50, +20, 46, 58.1, 6.48 },
-    {  3, 24, 26.09, +20, 48, 13.0, 6.08 },
-    {  1, 54, 38.40, +20, 48, 29.2, 2.64 },
-    { 18,  8, 45.50, +20, 48, 51.8, 4.36 },
-    { 18, 30, 41.59, +20, 48, 55.1, 6.50 },
-    {  4, 22, 22.80, +20, 49, 17.0, 5.91 },
-    { 23, 22, 40.51, +20, 49, 43.0, 6.29 },
-    { 19,  1, 22.61, +20, 50,  1.0, 6.69 },
-    { 18,  2, 23.11, +20, 50,  1.0, 5.28 },
-    { 23, 33, 55.51, +20, 50, 26.9, 6.06 },
-    { 22, 23, 39.60, +20, 50, 53.9, 6.04 },
-    {  5, 48, 22.39, +20, 52,  9.8, 6.07 },
-    { 12, 29, 43.20, +20, 53, 46.0, 5.69 },
-    { 20,  9, 56.59, +20, 54, 55.1, 6.48 },
-    {  3, 39,   .10, +20, 54, 56.9, 6.50 },
-    {  0, 47, 54.79, +20, 55, 31.1, 6.54 },
-    {  3, 44, 28.10, +20, 55, 43.0, 6.10 },
-    { 16, 54, 55.20, +20, 57, 31.0, 5.41 },
-    { 15, 51, 15.91, +20, 58, 40.1, 4.76 },
-    { 22, 10, 30.19, +20, 58, 41.2, 6.46 },
-    {  4, 23, 32.40, +20, 58, 55.9, 5.99 },
-    { 20, 34, 10.01, +20, 59,  7.1, 6.48 },
-    { 17, 35, 59.59, +20, 59, 46.0, 6.10 },
-    { 19, 57,   .19, +20, 59, 53.2, 6.48 },
-    {  1, 11, 27.19, +21,  2,  4.9, 4.66 },
-    {  3, 14, 54.10, +21,  2, 39.8, 4.89 },
-    {  1, 59, 35.71, +21,  3, 29.9, 5.87 },
-    { 12, 39,  7.30, +21,  3, 45.0, 5.46 },
-    { 14, 41, 54.19, +21,  7, 25.0, 6.38 },
-    { 16, 20,  4.30, +21,  7, 57.0, 6.05 },
-    { 23,  7, 28.70, +21,  8,  3.1, 5.99 },
-    { 20, 11,  3.50, +21,  8,  4.9, 6.22 },
-    {  4, 19, 26.09, +21,  8, 31.9, 5.35 },
-    {  5, 37, 38.69, +21,  8, 33.0, 3.00 },
-    {  3, 21, 13.61, +21,  8, 48.8, 5.28 },
-    { 13,  6, 21.19, +21,  9, 11.9, 5.99 },
-    { 10, 14, 29.69, +21, 10,  4.1, 6.02 },
-    {  9, 49, 50.11, +21, 10, 45.8, 6.09 },
-    { 20, 38, 31.30, +21, 12,  4.0, 4.82 },
-    {  2, 12, 48.10, +21, 12, 38.9, 5.27 },
-    { 19, 15, 17.40, +21, 13, 55.9, 5.64 },
-    { 21, 56, 24.00, +21, 14, 22.9, 6.40 },
-    { 12, 53, 17.81, +21, 14, 42.0, 4.90 },
-    {  7, 10,  6.70, +21, 14, 48.8, 6.43 },
-    {  0, 39, 21.79, +21, 15,  2.2, 5.87 },
-    { 13, 49, 42.79, +21, 15, 51.1, 4.91 },
-    { 19,  3, 42.50, +21, 16,  4.1, 6.52 },
-    { 21, 52, 18.19, +21, 16, 23.2, 6.89 },
-    {  5,  4, 21.60, +21, 16, 41.2, 6.19 },
-    {  9, 13, 37.30, +21, 16, 59.9, 6.48 },
-    {  2, 59, 12.70, +21, 20, 25.1, 4.63 },
-    {  2, 59, 12.70, +21, 20, 25.1, 4.63 },
-    { 11, 40, 47.09, +21, 21, 10.1, 5.26 },
-    { 19, 16, 13.01, +21, 23, 25.1, 4.77 },
-    {  0, 58, 18.89, +21, 24, 15.8, 6.37 },
-    { 20, 25, 40.51, +21, 24, 34.9, 5.66 },
-    { 18, 52, 16.39, +21, 25, 31.1, 5.48 },
-    {  0, 39, 55.61, +21, 26, 17.9, 5.36 },
-    {  7, 27, 44.40, +21, 26, 42.0, 5.22 },
-    { 12,  4, 16.61, +21, 27, 33.1, 5.87 },
-    {  1,  5, 41.69, +21, 27, 55.1, 5.56 },
-    {  8, 43, 17.09, +21, 28,  7.0, 4.66 },
-    {  1,  5, 40.90, +21, 28, 23.9, 5.34 },
-    { 16, 30, 13.20, +21, 29, 22.9, 2.77 },
-    {  7, 26, 50.21, +21, 32,  8.9, 6.54 },
-    { 19, 12, 36.70, +21, 33, 15.8, 5.93 },
-    { 14, 57,  3.60, +21, 33, 19.1, 6.49 },
-    {  4, 18, 23.21, +21, 34, 45.1, 5.65 },
-    {  8,  7, 45.79, +21, 34, 54.1, 5.30 },
-    {  5,  3,  5.71, +21, 35, 24.0, 4.64 },
-    { 18,  1, 29.90, +21, 35, 43.1, 5.18 },
-    { 18,  1, 30.41, +21, 35, 44.2, 4.96 },
-    { 20, 16, 19.70, +21, 35, 55.0, 6.13 },
-    {  4, 28,   .79, +21, 37, 12.0, 5.72 },
-    { 18,  5, 30.19, +21, 38, 48.8, 6.15 },
-    { 23, 52, 23.40, +21, 40, 14.9, 6.11 },
-    { 13, 58, 38.90, +21, 41, 46.0, 5.76 },
-    { 19,  8,  3.60, +21, 41, 56.0, 6.23 },
-    { 22,  7, 50.30, +21, 42, 10.1, 5.78 },
-    {  5,  7, 55.49, +21, 42, 16.9, 5.89 },
-    {  6, 51, 33.00, +21, 45, 40.0, 5.27 },
-    {  5, 39, 27.00, +21, 45, 46.1, 6.34 },
-    { 18, 23, 41.90, +21, 46, 10.9, 3.84 },
-    {  4, 19, 36.70, +21, 46, 25.0, 5.38 },
-    { 20, 39, 10.61, +21, 49,  1.9, 6.08 },
-    { 16,  7, 22.20, +21, 49, 21.0, 6.14 },
-    {  6, 11, 51.41, +21, 52,  7.0, 6.56 },
-    { 14, 14, 40.99, +21, 52, 23.9, 6.39 },
-    { 20, 11, 21.10, +21, 52, 32.2, 6.26 },
-    { 18, 13, 16.51, +21, 52, 49.1, 6.12 },
-    { 12, 35,  8.11, +21, 52, 53.0, 5.85 },
-    {  5, 27, 38.11, +21, 56, 12.8, 4.88 },
-    { 10,  2, 48.91, +21, 56, 57.1, 5.66 },
-    {  2, 38, 49.01, +21, 57, 41.0, 5.43 },
-    { 18, 20, 17.90, +21, 57, 41.0, 4.95 },
-    { 14, 40, 21.89, +21, 58, 32.2, 6.10 },
-    {  7, 20,  7.39, +21, 58, 55.9, 3.53 },
-    { 18, 45, 35.69, +21, 59,  6.0, 6.51 },
-    {  9, 10, 20.90, +21, 59, 47.0, 6.01 },
-    {  4,  5, 20.21, +22,  0, 32.0, 5.90 },
-    { 21, 20, 13.99, +22,  1, 35.0, 6.29 },
-    {  6, 39,  5.30, +22,  1, 50.9, 6.04 },
-    {  3, 51, 36.60, +22,  1, 54.1, 6.83 },
-    {  9,  9, 21.50, +22,  2, 44.2, 5.14 },
-    { 15,  0, 52.39, +22,  2, 44.2, 6.38 },
-    {  4,  4, 41.71, +22,  4, 54.8, 4.36 },
-    { 17,  6, 18.10, +22,  5,  3.1, 5.56 },
-    {  5, 19, 16.61, +22,  5, 47.0, 4.94 },
-    { 21, 28, 59.90, +22, 10, 45.8, 5.93 },
-    {  6,  9, 32.40, +22, 11, 24.0, 5.93 },
-    { 16, 31, 13.39, +22, 11, 43.1, 5.76 },
-    {  4, 25, 25.01, +22, 11, 58.9, 5.28 },
-    { 11, 42,  5.21, +22, 12, 38.9, 6.59 },
-    { 18,  6,  1.90, +22, 13,  8.0, 5.06 },
-    {  3, 49, 55.01, +22, 14, 39.8, 6.07 },
-    { 14, 32, 32.50, +22, 15, 36.0, 5.92 },
-    { 19,  1, 49.49, +22, 15, 50.0, 6.40 },
-    {  1, 50,  8.50, +22, 16, 31.1, 5.86 },
-    {  0, 14, 56.11, +22, 17,  3.1, 6.24 },
-    {  5, 15, 27.70, +22, 17,  4.9, 6.27 },
-    {  4, 25, 22.10, +22, 17, 38.0, 4.22 },
-    { 17, 50, 48.41, +22, 18, 59.0, 5.98 },
-    { 20, 58, 16.39, +22, 19, 32.9, 5.31 },
-    { 10, 56, 16.90, +22, 21,  6.1, 6.14 },
-    {  7, 43, 22.20, +22, 23, 57.8, 6.21 },
-    {  6,  1, 41.59, +22, 24,  2.9, 6.37 },
-    {  4, 12, 51.19, +22, 24, 49.0, 6.12 },
-    { 19, 41, 14.90, +22, 27, 10.1, 6.36 },
-    { 21, 10, 31.99, +22, 27, 16.9, 6.68 },
-    {  5, 30, 43.39, +22, 27, 45.0, 6.29 },
-    { 17, 55, 50.81, +22, 27, 51.1, 5.58 },
-    {  3, 56, 52.10, +22, 28, 41.2, 5.63 },
-    { 13, 41,  2.30, +22, 29, 44.9, 5.62 },
-    { 23, 33, 28.10, +22, 29, 56.0, 5.32 },
-    {  6, 14, 52.61, +22, 30, 24.1, 3.28 },
-    {  6, 22, 57.60, +22, 30, 49.0, 2.88 },
-    { 19, 36,  8.30, +22, 35,  8.9, 6.32 },
-    { 19, 51,  4.10, +22, 36, 36.0, 4.95 },
-    { 13,  6, 22.61, +22, 36, 58.0, 5.60 },
-    { 12, 34, 51.10, +22, 37, 45.1, 4.81 },
-    { 17,  0, 58.10, +22, 37, 55.9, 5.65 },
-    {  8,  6, 18.41, +22, 38,  8.2, 5.99 },
-    {  7,  5, 18.41, +22, 38, 13.9, 6.02 },
-    { 18, 54, 44.90, +22, 38, 42.0, 4.59 },
-    { 23, 56, 41.50, +22, 38, 53.2, 6.15 },
-    {  2,  6, 33.91, +22, 38, 53.9, 5.03 },
-    { 12, 39,  2.09, +22, 39, 33.8, 6.38 },
-    {  5, 42,  3.91, +22, 39, 37.1, 6.36 },
-    { 13, 43, 45.19, +22, 42,  1.1, 6.13 },
-    {  7,  7, 21.41, +22, 42, 13.0, 7.68 },
-    { 21, 34, 34.01, +22, 45, 16.9, 6.47 },
-    {  3, 28, 26.59, +22, 48, 15.1, 6.03 },
-    { 16,  2, 17.69, +22, 48, 15.8, 4.83 },
-    {  4, 26, 18.50, +22, 48, 49.0, 4.28 },
-    { 18, 59, 58.10, +22, 48, 52.9, 6.29 },
-    { 12, 50, 17.40, +22, 51, 47.9, 6.43 },
-    {  7, 32, 50.59, +22, 53, 16.1, 6.54 },
-    {  6, 12, 19.10, +22, 54, 29.9, 6.39 },
-    { 18,  2, 30.10, +22, 55, 23.2, 6.21 },
-    {  7, 23, 28.20, +22, 56, 43.1, 6.02 },
-    { 21, 46,  4.39, +22, 56, 56.0, 5.29 },
-    {  4, 42, 14.69, +22, 57, 24.8, 4.28 },
-    { 17, 24,  6.60, +22, 57, 37.1, 5.74 },
-    {  9, 31, 43.20, +22, 58,  5.2, 4.31 },
-    {  9,  7, 26.90, +22, 58, 52.0, 6.40 },
-    { 15, 13, 31.90, +22, 58, 59.9, 6.30 },
-    {  4, 27, 17.50, +22, 59, 47.0, 5.53 },
-    {  7, 40, 58.51, +23,  1,  7.0, 5.89 },
-    { 19, 17, 43.61, +23,  1, 32.2, 5.43 },
-    { 12, 19, 19.10, +23,  2,  4.9, 6.27 },
-    { 23, 29,  5.59, +23,  2, 52.1, 6.35 },
-    { 17, 17, 35.90, +23,  5, 26.9, 6.45 },
-    { 11, 15, 12.19, +23,  5, 44.2, 4.63 },
-    { 19, 59, 10.51, +23,  6,  5.0, 5.67 },
-    { 10, 17, 14.59, +23,  6, 22.0, 5.82 },
-    {  6,  9, 43.99, +23,  6, 47.9, 5.75 },
-    {  8, 13, 41.71, +23,  8, 16.1, 6.56 },
-    {  7, 48, 33.60, +23,  8, 28.0, 6.18 },
-    {  2, 18, 58.01, +23, 10,  4.1, 6.46 },
-    {  3, 57,  3.79, +23, 10, 32.2, 6.06 },
-    { 10, 43, 25.01, +23, 11, 17.9, 5.08 },
-    {  5, 43, 19.51, +23, 12, 15.1, 6.21 },
-    { 20,  4, 58.61, +23, 12, 37.1, 6.45 },
-    { 14, 36,  6.89, +23, 15,  1.1, 6.38 },
-    {  6,  4,  7.20, +23, 15, 47.9, 4.16 },
-    { 18, 22,  8.71, +23, 17,  7.1, 5.41 },
-    { 18, 18,  7.70, +23, 17, 48.1, 6.63 },
-    { 11,  7, 39.70, +23, 19, 25.0, 6.46 },
-    {  5, 41, 54.60, +23, 19, 35.0, 6.59 },
-    {  6, 25, 32.90, +23, 19, 36.8, 6.06 },
-    {  4, 36, 29.21, +23, 20, 26.9, 6.02 },
-    { 21, 32, 27.10, +23, 23, 39.8, 6.70 },
-    { 23, 25, 22.80, +23, 24, 15.1, 4.40 },
-    { 10, 16, 41.40, +23, 25,  1.9, 3.44 },
-    {  0, 57, 12.41, +23, 25,  3.0, 4.42 },
-    {  3, 48, 20.90, +23, 25, 16.0, 5.45 },
-    {  9, 33, 59.09, +23, 27, 14.0, 6.25 },
-    {  2,  7, 10.39, +23, 27, 45.0, 2.00 },
-    {  2, 29, 13.61, +23, 28,  8.0, 6.19 },
-    { 16, 11, 37.99, +23, 29, 40.9, 5.70 },
-    { 10, 16, 32.30, +23, 30, 11.2, 5.97 },
-    { 20, 15, 30.19, +23, 30, 31.0, 5.15 },
-    {  1, 25, 35.71, +23, 30, 42.1, 6.18 },
-    { 18, 48, 16.39, +23, 30, 51.1, 6.15 },
-    { 22, 46, 31.90, +23, 33, 56.2, 3.95 },
-    {  1, 55, 51.00, +23, 34, 37.9, 5.74 },
-    {  8,  1,   .70, +23, 34, 59.2, 6.34 },
-    { 18, 44, 40.20, +23, 35, 22.9, 6.31 },
-    {  1, 57, 55.70, +23, 35, 46.0, 4.79 },
-    {  6, 52,   .00, +23, 36,  6.1, 5.65 },
-    { 18, 35, 30.41, +23, 36, 20.2, 5.61 },
-    { 20,  6, 53.40, +23, 36, 51.8, 5.07 },
-    { 18, 32, 46.20, +23, 37,   .8, 5.84 },
-    {  4, 45, 42.50, +23, 37, 41.2, 6.35 },
-    {  0, 54, 58.01, +23, 37, 41.9, 5.47 },
-    { 21, 29, 56.90, +23, 38, 20.0, 4.57 },
-    { 20, 38, 35.09, +23, 40, 50.2, 5.91 },
-    {  3, 49, 43.51, +23, 42, 42.1, 6.17 },
-    { 19, 40, 39.70, +23, 43,  3.0, 6.64 },
-    { 23, 20, 38.21, +23, 44, 25.1, 4.60 },
-    {  6, 16, 58.70, +23, 44, 26.9, 6.25 },
-    { 17, 15, 41.59, +23, 44, 34.1, 5.96 },
-    {  2, 17, 10.39, +23, 46,  4.1, 6.55 },
-    {  9, 45, 51.10, +23, 46, 27.1, 2.98 },
-    { 13, 25,  6.70, +23, 51, 15.8, 5.78 },
-    { 21, 21,  4.39, +23, 51, 20.9, 5.57 },
-    { 18, 29, 35.69, +23, 51, 58.0, 5.90 },
-    { 14, 50, 15.79, +23, 54, 42.8, 5.85 },
-    { 12, 25, 15.10, +23, 55, 34.0, 6.03 },
-    { 18,  4, 40.20, +23, 56, 33.0, 6.34 },
-    { 12, 16, 20.50, +23, 56, 43.1, 4.95 },
-    {  3, 46, 19.61, +23, 56, 53.9, 4.18 },
-    {  4, 57, 48.70, +23, 56, 55.0, 5.79 },
-    {  6, 16, 19.01, +23, 58, 12.0, 6.08 },
-    { 17, 57, 14.30, +23, 59, 44.9, 6.30 },
-    {  0, 37,  7.20, +24,  0, 51.1, 6.47 },
-    {  8, 20, 32.11, +24,  1, 19.9, 5.98 },
-    {  5, 35, 27.10, +24,  2, 21.8, 5.38 },
-    {  3, 49,  9.70, +24,  3, 11.9, 3.63 },
-    { 19, 53, 27.70, +24,  4, 46.9, 4.58 },
-    {  8, 31, 30.50, +24,  4, 52.0, 5.75 },
-    {  8, 33,   .10, +24,  5,  4.9, 6.36 },
-    {  4, 43, 13.80, +24,  5, 20.0, 6.13 },
-    { 23, 14, 36.50, +24,  6, 11.2, 6.36 },
-    {  3, 47, 29.11, +24,  6, 18.0, 2.87 },
-    {  4,  4, 21.70, +24,  6, 20.9, 5.47 },
-    { 12, 29, 26.90, +24,  6, 32.0, 5.48 },
-    {  3, 44, 52.51, +24,  6, 47.9, 3.70 },
-    { 20, 38, 31.90, +24,  6, 58.0, 5.04 },
-    {  7, 12, 26.40, +24,  7, 41.9, 5.85 },
-    {  3, 49, 11.21, +24,  8, 12.1, 5.09 },
-    {  8, 28, 36.79, +24,  8, 40.9, 6.10 },
-    {  2, 12, 37.49, +24, 10,  4.1, 5.96 },
-    {  7,  2, 24.79, +24, 12, 55.1, 5.18 },
-    {  7, 39, 11.90, +24, 13, 21.0, 6.17 },
-    { 17, 11,  3.19, +24, 14, 16.1, 6.19 },
-    { 20, 13, 40.61, +24, 14, 20.0, 6.56 },
-    {  5, 56, 56.09, +24, 14, 58.9, 6.02 },
-    { 19,  6, 38.40, +24, 15,  2.9, 5.77 },
-    { 13, 12,  8.40, +24, 15, 29.2, 6.33 },
-    {  5,  8,  6.60, +24, 15, 55.1, 5.50 },
-    {  0, 47, 20.30, +24, 16,  1.9, 4.06 },
-    { 21, 23, 58.80, +24, 16, 27.1, 5.71 },
-    { 12, 33, 34.20, +24, 16, 59.2, 6.29 },
-    {  3, 44, 48.19, +24, 17, 21.8, 5.46 },
-    {  4, 23, 59.81, +24, 18,  4.0, 6.36 },
-    { 17, 37, 31.10, +24, 18, 36.0, 5.77 },
-    { 19, 54, 31.10, +24, 19,  9.8, 5.52 },
-    { 17, 43, 21.60, +24, 19, 40.1, 5.71 },
-    { 13, 32, 48.10, +24, 20, 47.0, 6.11 },
-    {  7, 38, 14.50, +24, 21, 37.1, 6.27 },
-    { 14, 48, 23.30, +24, 22,   .1, 6.14 },
-    {  3, 45, 49.61, +24, 22,  4.1, 3.87 },
-    { 16, 57, 42.31, +24, 22, 53.0, 6.32 },
-    {  9, 51, 52.99, +24, 23, 43.1, 5.32 },
-    {  7, 44, 26.81, +24, 23, 53.2, 3.57 },
-    {  6, 11, 32.30, +24, 25, 13.1, 5.80 },
-    { 20, 22,  3.41, +24, 26, 46.0, 5.54 },
-    { 18, 19, 10.70, +24, 26, 46.0, 5.27 },
-    { 21, 35, 27.00, +24, 27,  7.9, 6.11 },
-    {  9,  2, 44.30, +24, 27, 10.1, 5.45 },
-    {  3, 57, 26.40, +24, 27, 42.8, 6.16 },
-    {  3, 34, 26.59, +24, 27, 51.8, 5.92 },
-    {  3, 45, 12.50, +24, 28,  1.9, 4.30 },
-    { 17, 20, 54.19, +24, 29, 57.8, 5.12 },
-    { 17, 41,  5.50, +24, 30, 47.9, 6.36 },
-    {  3, 46,  2.90, +24, 31, 41.2, 6.43 },
-    { 21, 24, 23.11, +24, 31, 44.0, 6.32 },
-    {  8, 26, 39.79, +24, 32,  3.1, 7.02 },
-    {  8, 26, 40.10, +24, 32,  7.1, 7.81 },
-    {  3, 45, 54.41, +24, 33, 16.9, 5.76 },
-    {  0, 55, 14.69, +24, 33, 24.8, 6.20 },
-    { 23, 35, 55.90, +24, 33, 40.0, 6.45 },
-    { 17, 42, 28.39, +24, 33, 51.1, 5.52 },
-    { 12, 31,   .60, +24, 34,  1.9, 5.46 },
-    {  5, 49,  1.01, +24, 34,  3.0, 4.86 },
-    {  1, 13, 44.90, +24, 35,  1.0, 4.65 },
-    {  6, 37, 27.19, +24, 35, 26.9, 6.44 },
-    {  4, 56, 15.60, +24, 35, 31.9, 6.37 },
-    {  6, 39, 31.39, +24, 36,   .0, 6.38 },
-    { 22, 50,   .19, +24, 36,  6.1, 3.48 },
-    { 13, 36, 59.09, +24, 36, 47.9, 5.74 },
-    {  0, 41, 36.00, +24, 37, 45.1, 6.04 },
-    {  2, 37,   .50, +24, 38, 51.0, 6.50 },
-    {  2, 36, 57.70, +24, 38, 53.9, 7.09 },
-    { 16, 51, 45.31, +24, 39, 23.0, 5.04 },
-    { 11,  8, 49.10, +24, 39, 29.9, 5.68 },
-    { 19, 28, 42.29, +24, 39, 54.0, 4.44 },
-    { 20, 16, 47.11, +24, 40, 16.0, 5.32 },
-    {  7, 14, 26.59, +24, 42, 38.9, 6.89 },
-    { 10, 19,   .70, +24, 42, 42.1, 6.40 },
-    {  3, 24, 18.50, +24, 43, 27.1, 5.50 },
-    { 10, 55, 37.30, +24, 44, 56.0, 6.30 },
-    { 10, 55, 36.79, +24, 44, 58.9, 4.50 },
-    { 19, 28, 57.00, +24, 46,  7.0, 5.81 },
-    { 23, 15, 57.89, +24, 46, 16.0, 6.60 },
-    { 12, 22, 10.80, +24, 46, 26.0, 6.19 },
-    { 20,  1, 44.69, +24, 48,  1.1, 5.88 },
-    { 17, 15,  1.90, +24, 50, 21.1, 3.14 },
-    {  3, 45,  9.70, +24, 50, 21.1, 5.64 },
-    { 12, 48, 46.99, +24, 50, 25.1, 6.31 },
-    { 16, 41,   .60, +24, 51, 31.0, 6.06 },
-    { 15,  7, 18.10, +24, 52,  9.1, 4.93 },
-    {  7, 14, 41.90, +24, 53,  6.0, 5.82 },
-    { 19, 25, 25.80, +24, 54, 46.1, 6.19 },
-    { 20,  2,  1.39, +24, 56, 17.2, 5.22 },
-    { 22, 12,  7.99, +24, 57,   .0, 5.92 },
-    { 15, 21,  6.89, +24, 57, 28.1, 6.39 },
-    { 19, 52,  1.61, +24, 59, 31.9, 5.57 },
-    { 15,  2,  6.50, +25,  0, 29.2, 4.81 },
-    { 19,  1, 34.90, +25,  1, 32.9, 6.72 },
-    {  2, 15, 42.79, +25,  2, 35.2, 5.58 },
-    { 18, 49, 14.40, +25,  2, 47.0, 6.59 },
-    {  4, 58,  9.41, +25,  3,  1.1, 5.81 },
-    {  7, 23, 28.51, +25,  3,  2.2, 5.03 },
-    {  8,  1, 43.80, +25,  5, 22.9, 6.31 },
-    { 14, 10, 23.90, +25,  5, 30.1, 4.83 },
-    { 15, 27, 38.90, +25,  6,  6.1, 6.02 },
-    { 15,  8, 35.50, +25,  6, 31.0, 5.81 },
-    {  6, 43, 55.90, +25,  7, 52.0, 2.98 },
-    { 19, 46, 39.50, +25,  8,  2.0, 6.62 },
-    { 23, 57, 45.50, +25,  8, 29.0, 4.66 },
-    {  5, 29, 16.49, +25,  9,  2.2, 5.47 },
-    { 23, 27, 40.39, +25, 10,  1.9, 5.98 },
-    {  9, 23, 31.80, +25, 10, 59.2, 6.41 },
-    {  2, 48, 45.89, +25, 11, 17.2, 5.86 },
-    {  4, 39, 23.11, +25, 13,  5.9, 6.22 },
-    { 11, 44, 13.20, +25, 13,  5.9, 6.02 },
-    {  2, 30, 32.40, +25, 14,  6.0, 5.92 },
-    {  3,  5, 26.71, +25, 15, 19.1, 7.00 },
-    {  3,  5, 26.71, +25, 15, 19.1, 6.80 },
-    { 20, 44, 52.51, +25, 16, 14.2, 4.91 },
-    { 21, 24,  7.39, +25, 18, 43.9, 6.15 },
-    {  3, 40, 46.30, +25, 19, 45.8, 6.11 },
-    { 14, 23,  6.79, +25, 20, 17.2, 6.22 },
-    { 22,  7,   .70, +25, 20, 42.0, 3.76 },
-    { 16, 57, 31.01, +25, 21, 10.1, 6.28 },
-    { 10, 16, 41.90, +25, 22, 17.0, 5.84 },
-    {  6, 55, 18.60, +25, 22, 32.2, 5.73 },
-    { 19, 47, 48.60, +25, 23,  2.0, 5.95 },
-    {  8,  0, 55.90, +25, 23, 34.1, 5.83 },
-    {  1, 10, 19.39, +25, 27, 28.1, 5.80 },
-    {  0,  8, 52.20, +25, 27, 46.1, 6.23 },
-    { 23,  7,  6.79, +25, 28,  5.9, 4.76 },
-    { 10, 54, 42.19, +25, 29, 26.9, 6.20 },
-    { 21, 38, 45.00, +25, 29, 56.0, 6.16 },
-    { 10, 56, 34.39, +25, 30,   .0, 6.35 },
-    { 17,  2, 18.70, +25, 30, 20.2, 5.75 },
-    {  8, 10, 27.19, +25, 30, 25.9, 5.73 },
-    { 17, 20,  9.79, +25, 32, 15.0, 5.38 },
-    { 22,  8, 17.21, +25, 32, 37.0, 6.11 },
-    { 21, 46, 24.00, +25, 33, 47.9, 6.28 },
-    {  3, 50, 18.91, +25, 34, 45.8, 5.26 },
-    { 12, 24, 26.71, +25, 34, 58.1, 6.42 },
-    { 20, 15, 15.91, +25, 35, 30.8, 4.78 },
-    { 17, 48, 49.20, +25, 37, 22.1, 5.12 },
-    {  4, 22, 34.90, +25, 37, 45.1, 5.37 },
-    {  2, 43, 51.19, +25, 38, 17.2, 6.35 },
-    { 21, 44, 38.71, +25, 38, 42.0, 4.13 },
-    {  3, 20, 25.61, +25, 39, 46.1, 6.12 },
-    { 13, 46, 43.30, +25, 42,  7.9, 5.95 },
-    {  2,  6, 49.20, +25, 42, 16.9, 6.15 },
-    { 16, 55,  2.09, +25, 43, 50.2, 6.08 },
-    {  1, 41, 18.41, +25, 44, 44.9, 6.17 },
-    { 19, 43, 42.89, +25, 46, 18.8, 5.49 },
-    {  2, 15, 46.01, +25, 46, 59.2, 5.79 },
-    {  7, 44,  6.89, +25, 47,  3.1, 5.31 },
-    { 20, 31, 58.20, +25, 48, 15.8, 6.34 },
-    { 12, 22, 30.31, +25, 50, 46.0, 4.81 },
-    { 12, 11, 51.19, +25, 52, 13.1, 5.66 },
-    { 20, 36,  8.30, +25, 52, 57.0, 6.41 },
-    {  5, 39, 44.21, +25, 53, 48.8, 5.18 },
-    { 12, 28, 44.59, +25, 53, 57.1, 6.65 },
-    {  9, 41, 38.50, +25, 54, 46.1, 6.24 },
-    { 12, 28, 54.70, +25, 54, 46.1, 5.29 },
-    {  6, 59, 27.89, +25, 54, 51.1, 6.40 },
-    { 15, 59, 30.19, +25, 55, 13.1, 2.00 },
-    { 21, 53,  3.79, +25, 55, 30.0, 5.08 },
-    {  2,  3, 39.29, +25, 56,  8.2, 5.63 },
-    {  2, 11, 12.00, +25, 56, 12.8, 6.02 },
-    {  5, 36, 30.19, +25, 56, 21.8, 6.49 },
-    {  2,  9, 25.30, +25, 56, 22.9, 4.98 },
-    {  5, 57, 59.69, +25, 57, 14.0, 4.82 },
-    { 23, 55, 22.99, +25, 57, 18.0, 6.54 },
-    { 12, 20, 17.69, +26,  0,  6.8, 6.15 },
-    {  9, 52, 45.79, +26,  0, 24.8, 3.88 },
-    { 12, 19,  2.09, +26,  0, 28.1, 6.48 },
-    { 17, 55, 25.20, +26,  3,   .0, 5.46 },
-    { 15, 49, 35.69, +26,  4,  5.9, 4.63 },
-    {  6, 58, 47.40, +26,  4, 52.0, 6.10 },
-    { 18,  7, 49.49, +26,  5, 51.0, 5.90 },
-    { 12, 24, 18.50, +26,  5, 55.0, 5.18 },
-    { 18,  7, 49.49, +26,  6,  5.0, 5.86 },
-    { 17, 30, 44.30, +26,  6, 38.2, 4.41 },
-    { 21, 24, 34.01, +26, 10, 27.8, 5.68 },
-    {  9, 24, 39.31, +26, 10, 55.9, 4.46 },
-    { 12, 28, 38.11, +26, 13, 36.1, 6.54 },
-    { 18, 59, 45.50, +26, 13, 50.2, 5.27 },
-    { 19, 22, 50.90, +26, 15, 45.0, 5.18 },
-    { 19,  1, 17.40, +26, 17, 29.0, 5.69 },
-    { 15, 42, 44.59, +26, 17, 44.2, 3.84 },
-    { 15,  8, 23.81, +26, 18,  4.0, 5.67 },
-    { 10, 43,  1.80, +26, 19, 32.2, 5.51 },
-    { 18, 26, 40.90, +26, 26, 57.8, 6.53 },
-    { 20, 37,  4.70, +26, 27, 42.8, 5.59 },
-    {  3,  1, 54.10, +26, 27, 43.9, 5.90 },
-    { 20, 12,   .70, +26, 28, 44.0, 5.92 },
-    {  4, 10, 49.90, +26, 28, 50.9, 5.41 },
-    { 14, 43, 25.39, +26, 31, 40.1, 4.81 },
-    { 23, 21, 58.20, +26, 36, 32.0, 6.62 },
-    { 19, 31, 21.79, +26, 37,  1.9, 5.87 },
-    {  5, 38, 57.41, +26, 37,  4.1, 6.37 },
-    { 12, 20, 19.70, +26, 37,  9.8, 5.54 },
-    {  9,  8, 47.30, +26, 37, 45.1, 5.98 },
-    {  0,  4, 55.99, +26, 38, 56.0, 6.25 },
-    { 18, 46,  4.49, +26, 39, 43.9, 4.83 },
-    { 16, 12, 45.31, +26, 40, 14.9, 6.50 },
-    { 22,  5, 11.40, +26, 40, 26.0, 5.78 },
-    { 14, 32, 20.21, +26, 40, 37.9, 6.01 },
-    { 15, 34, 41.30, +26, 42, 52.9, 2.23 },
-    { 19, 11, 30.91, +26, 44,  8.9, 6.36 },
-    { 22, 29, 10.20, +26, 45, 47.2, 5.79 },
-    {  7, 53, 29.81, +26, 45, 56.9, 4.97 },
-    { 20, 11, 48.00, +26, 48, 32.0, 5.49 },
-    { 12, 26, 59.30, +26, 49, 32.2, 5.00 },
-    { 23, 11, 49.20, +26, 50, 49.9, 6.17 },
-    {  7, 11, 23.11, +26, 51, 24.1, 5.78 },
-    { 15, 57, 35.30, +26, 52, 40.1, 4.15 },
-    { 17, 26,   .91, +26, 52, 44.0, 6.41 },
-    {  7, 35, 55.30, +26, 53, 44.9, 4.06 },
-    {  3, 10, 27.00, +26, 53, 47.0, 6.02 },
-    { 20, 10, 33.50, +26, 54, 15.1, 5.52 },
-    { 16, 41, 36.70, +26, 55,   .8, 5.92 },
-    {  0,  0, 23.90, +26, 55,  5.9, 6.46 },
-    {  5, 37,  8.81, +26, 55, 27.1, 5.83 },
-    { 21,  6, 23.50, +26, 55, 27.8, 6.12 },
-    {  8, 26, 46.80, +26, 56,  3.8, 6.32 },
-    { 22, 21,   .10, +26, 56,  7.1, 6.47 },
-    {  8, 26, 46.99, +26, 56,  7.1, 6.30 },
-    {  4, 38, 29.59, +26, 56, 24.0, 6.47 },
-    { 15,  4, 26.71, +26, 56, 51.0, 4.54 },
-    {  6, 28, 56.59, +26, 58,  4.1, 6.47 },
-    {  0, 13, 24.00, +26, 59, 13.9, 6.30 },
-    {  2, 27,  7.01, +27,  0, 47.9, 6.18 },
-    { 12, 20, 41.30, +27,  3, 16.9, 7.13 },
-    {  2, 40, 41.09, +27,  3, 38.9, 5.30 },
-    {  3, 19, 55.80, +27,  4, 16.0, 5.90 },
-    { 14, 44, 59.21, +27,  4, 27.1, 2.70 },
-    { 14, 44, 59.21, +27,  4, 30.0, 5.12 },
-    {  0,  2, 10.20, +27,  4, 54.8, 5.75 },
-    { 20, 52,  7.70, +27,  5, 48.8, 4.59 },
-    { 19, 43, 55.90, +27,  8,  8.2, 6.28 },
-    { 10, 13, 49.80, +27,  8,  8.9, 6.04 },
-    { 17,  1,  9.60, +27, 11, 47.0, 6.55 },
-    {  0, 55, 58.49, +27, 12, 33.8, 6.09 },
-    {  8, 20,  3.91, +27, 13,  4.1, 5.14 },
-    {  7, 12, 49.01, +27, 13, 28.9, 6.43 },
-    {  0, 36, 19.99, +27, 15, 16.9, 6.50 },
-    {  3, 12, 14.21, +27, 15, 24.8, 5.79 },
-    {  2, 49, 58.99, +27, 15, 38.2, 3.63 },
-    {  1, 19, 28.01, +27, 15, 51.1, 4.76 },
-    { 12, 26, 24.10, +27, 16,  5.9, 4.95 },
-    { 12, 10, 46.10, +27, 16, 53.0, 6.01 },
-    {  0, 15, 10.61, +27, 16, 59.2, 6.35 },
-    { 19, 47, 37.90, +27, 18, 40.0,      },
-    {  4, 20, 21.31, +27, 21,  2.9, 4.95 },
-    { 14,  1, 10.49, +27, 23, 12.1, 6.23 },
-    { 18, 24, 58.49, +27, 23, 43.1, 6.27 },
-    { 10, 18, 10.30, +27, 24, 55.1, 6.52 },
-    { 16, 15, 47.40, +27, 25, 19.9, 6.14 },
-    { 19, 15, 57.00, +27, 27, 20.2, 6.54 },
-    { 13, 56, 34.20, +27, 29, 30.8, 5.01 },
-    {  8,  5, 37.01, +27, 31, 46.9, 6.21 },
-    { 12, 51, 41.90, +27, 32, 26.2, 4.94 },
-    { 12, 49, 17.40, +27, 33,  7.9, 5.78 },
-    { 13,  7, 53.59, +27, 33, 20.9, 6.19 },
-    {  3, 31, 20.81, +27, 34, 18.8, 5.96 },
-    {  6,  1,   .41, +27, 34, 19.9, 6.05 },
-    {  0, 32, 34.51, +27, 34, 50.2, 6.67 },
-    {  4,  6, 36.41, +27, 36,   .0, 5.20 },
-    {  3, 22, 11.90, +27, 36, 27.0, 5.52 },
-    { 21, 27, 40.10, +27, 36, 31.0, 5.41 },
-    {  5, 53, 19.61, +27, 36, 43.9, 4.58 },
-    { 13,  7, 10.70, +27, 37, 28.9, 4.80 },
-    {  7, 24, 33.41, +27, 38, 17.2, 5.76 },
-    {  5, 35, 55.49, +27, 39, 43.9, 6.27 },
-    {  5,  4, 37.90, +27, 41, 46.0, 6.60 },
-    {  2, 43, 27.10, +27, 42, 25.9, 4.66 },
-    {  0, 49, 53.21, +27, 42, 37.1, 7.10 },
-    {  0, 49, 52.80, +27, 42, 38.9, 7.00 },
-    { 17, 46, 27.50, +27, 43, 14.2, 3.42 },
-    { 20,  1,  6.10, +27, 45, 13.0, 4.64 },
-    {  9, 58, 26.09, +27, 45, 32.0, 6.30 },
-    { 11, 36, 17.90, +27, 46, 52.0, 5.80 },
-    {  8,  3, 31.10, +27, 47, 39.1, 4.94 },
-    {  7, 25, 43.61, +27, 47, 53.2, 3.79 },
-    { 22, 16, 29.69, +27, 48, 15.1, 6.37 },
-    {  1, 57, 43.80, +27, 48, 15.8, 5.82 },
-    { 20, 15, 46.10, +27, 48, 51.1, 4.52 },
-    {  3, 10,  8.81, +27, 49, 12.0, 6.42 },
-    { 13, 11, 52.39, +27, 52, 41.2, 4.26 },
-    {  8, 26, 27.70, +27, 53, 37.0, 5.57 },
-    {  4, 52, 47.11, +27, 53, 51.0, 5.97 },
-    {  7, 15, 57.10, +27, 53, 51.0, 5.71 },
-    {  9,  4,  9.89, +27, 53, 53.9, 6.38 },
-    {  9,  1, 48.91, +27, 54, 10.1, 6.07 },
-    { 18, 54, 13.20, +27, 54, 33.8, 5.62 },
-    {  7, 29, 48.70, +27, 54, 58.0, 5.01 },
-    { 19, 15, 59.40, +27, 55, 36.8, 6.16 },
-    {  8, 55, 39.70, +27, 55, 39.0, 5.22 },
-    {  5, 20, 59.30, +27, 57, 25.9, 6.33 },
-    { 19, 30, 43.30, +27, 57, 34.9, 3.08 },
-    { 19, 30, 45.31, +27, 57, 55.1, 5.11 },
-    {  5, 50, 58.10, +27, 58,  4.1, 5.56 },
-    { 10, 49, 53.71, +27, 58, 26.0, 6.04 },
-    {  6, 35, 12.10, +28,  1, 19.9, 5.27 },
-    {  7, 45, 18.91, +28,  1, 34.0, 1.14 },
-    {  5,  9, 45.10, +28,  1, 50.2, 6.01 },
-    { 20, 54, 33.60, +28,  3, 27.0, 5.01 },
-    { 13, 40, 39.10, +28,  3, 55.1, 6.23 },
-    { 23,  3, 46.51, +28,  4, 58.1, 2.42 },
-    { 19, 24, 22.39, +28,  5, 16.1, 6.53 },
-    {  7, 29, 20.40, +28,  7,  5.2, 5.05 },
-    { 15, 48, 34.39, +28,  9, 24.1, 5.85 },
-    { 12, 19, 29.59, +28,  9, 24.8, 6.33 },
-    {  7,  7, 25.01, +28, 10, 37.9, 6.48 },
-    { 17, 36,  7.90, +28, 11,  4.9, 6.38 },
-    {  6, 41, 21.00, +28, 11, 47.0, 6.42 },
-    { 21, 35, 19.01, +28, 11, 49.9, 6.31 },
-    { 23, 15, 46.30, +28, 14, 52.1, 6.49 },
-    { 20, 51, 28.20, +28, 15,  2.2, 5.77 },
-    {  8, 52, 28.61, +28, 15, 33.1, 6.23 },
-    {  6, 39, 33.10, +28, 15, 47.2, 6.03 },
-    { 12, 26, 56.30, +28, 16,  5.9, 4.36 },
-    {  3,  3, 30.31, +28, 16, 10.9, 6.36 },
-    {  0, 32, 49.10, +28, 16, 49.1, 6.30 },
-    { 14, 28, 31.51, +28, 17, 21.1, 7.62 },
-    { 14, 28, 33.29, +28, 17, 26.9, 7.12 },
-    { 22, 21, 19.30, +28, 19, 50.2, 4.81 },
-    {  8, 52, 35.81, +28, 19, 50.9, 5.95 },
-    {  9, 33, 18.29, +28, 22,  5.2, 6.53 },
-    { 23, 31, 43.10, +28, 24, 13.0, 6.41 },
-    { 17, 31, 49.61, +28, 24, 27.0, 5.62 },
-    { 19, 49, 54.60, +28, 26, 26.2, 6.38 },
-    { 20, 54, 22.39, +28, 31, 18.8, 6.56 },
-    {  1, 14,  4.99, +28, 31, 46.9, 6.43 },
-    { 12, 12,  1.20, +28, 32, 10.0, 6.49 },
-    {  5, 26, 17.50, +28, 36, 27.0, 1.65 },
-    { 22, 13, 38.59, +28, 36, 29.9, 5.89 },
-    {  4, 41, 19.80, +28, 36, 54.0, 5.78 },
-    { 14, 49, 58.39, +28, 36, 56.9, 5.80 },
-    { 19,  6, 37.70, +28, 37, 43.0, 5.55 },
-    {  2, 18, 57.00, +28, 38, 33.0, 5.03 },
-    { 13, 53, 10.30, +28, 38, 53.2, 5.90 },
-    { 10, 16, 28.10, +28, 40, 57.0, 6.49 },
-    { 20, 14, 14.50, +28, 41, 40.9, 5.18 },
-    {  1, 21,  7.39, +28, 44, 17.2, 5.23 },
-    { 21, 44,  8.59, +28, 44, 34.1, 4.73 },
-    { 21, 44,  8.30, +28, 44, 35.2, 6.08 },
-    { 17, 21, 31.20, +28, 45, 29.2, 6.35 },
-    {  8, 46, 41.81, +28, 45, 36.0, 4.02 },
-    { 18,  7, 32.59, +28, 45, 45.0, 3.83 },
-    {  8, 46, 40.01, +28, 45, 55.1, 6.57 },
-    { 18, 51, 35.90, +28, 47,  1.0, 6.18 },
-    { 21, 52, 29.90, +28, 47, 35.9, 5.53 },
-    { 17, 18, 48.50, +28, 49, 23.2, 5.65 },
-    { 23, 49, 39.41, +28, 50, 33.0, 5.97 },
-    { 18, 21,  1.01, +28, 52, 12.0, 5.12 },
-    {  7, 43, 18.70, +28, 53,  1.0, 4.28 },
-    {  5, 23, 22.90, +28, 56, 12.1, 6.46 },
-    { 12, 17, 30.50, +28, 56, 13.9, 5.70 },
-    {  5, 56, 33.79, +28, 56, 31.9, 6.32 },
-    {  4, 34, 37.99, +28, 57, 40.0, 5.88 },
-    { 22,  5, 34.70, +28, 57, 50.0, 5.70 },
-    {  6, 44, 45.50, +28, 58, 14.9, 5.44 },
-    {  6, 38, 22.99, +28, 59,  3.1, 5.79 },
-    {  0, 57, 50.21, +28, 59, 31.9, 5.42 },
-    {  4,  7,   .50, +29,  0,  5.0, 5.23 },
-    {  0,  6, 36.79, +29,  1, 17.0, 6.13 },
-    { 13,  6, 10.20, +29,  1, 45.8, 6.54 },
-    {  3, 20, 20.40, +29,  2, 53.9, 4.47 },
-    {  3,  9, 36.70, +29,  4, 36.8, 5.72 },
-    {  0,  8, 23.30, +29,  5, 26.2, 2.06 },
-    { 15, 27, 49.70, +29,  6, 20.9, 3.68 },
-    { 20, 17, 31.51, +29,  8, 53.2, 6.22 },
-    { 16, 16, 44.81, +29,  9,  1.1, 5.78 },
-    { 15, 14, 29.21, +29,  9, 51.1, 5.26 },
-    {  5, 29, 40.61, +29, 11, 11.0, 6.24 },
-    { 18, 14, 43.99, +29, 12, 25.9, 6.56 },
-    {  5, 39, 18.41, +29, 12, 55.1, 5.96 },
-    {  2, 47, 54.50, +29, 14, 49.9, 4.51 },
-    { 17, 57, 45.91, +29, 14, 52.1, 3.70 },
-    { 19, 44, 48.70, +29, 15, 52.9, 6.82 },
-    { 22, 41, 45.41, +29, 18, 27.0, 4.79 },
-    { 10, 16, 14.40, +29, 18, 38.2, 5.35 },
-    {  0, 38, 33.31, +29, 18, 42.1, 4.37 },
-    { 17, 50, 22.90, +29, 19, 19.9, 5.50 },
-    { 19, 42, 49.10, +29, 19, 54.1, 6.49 },
-    { 19, 37,  9.41, +29, 20,  1.0, 6.43 },
-    {  7,  3, 30.41, +29, 20, 13.9, 5.93 },
-    { 23, 43, 59.50, +29, 21, 42.1, 4.93 },
-    { 10, 48, 57.19, +29, 24, 56.9, 6.15 },
-    { 23, 13,  4.01, +29, 26, 30.1, 6.35 },
-    { 19, 34, 50.90, +29, 27, 47.2, 5.38 },
-    {  5, 41, 21.00, +29, 29, 15.0, 6.43 },
-    {  6, 15, 22.70, +29, 29, 53.2, 4.35 },
-    {  6,  6, 22.51, +29, 30, 45.0, 6.08 },
-    {  6, 21, 12.10, +29, 32, 28.0, 6.43 },
-    { 22, 31, 34.20, +29, 32, 34.1, 6.35 },
-    {  5, 21, 12.70, +29, 34, 12.0, 5.76 },
-    {  1, 53,  4.90, +29, 34, 44.0, 3.41 },
-    { 10, 23, 41.81, +29, 36, 56.9, 6.39 },
-    { 15, 20,  8.50, +29, 36, 58.0, 5.51 },
-    { 19, 24,  7.61, +29, 37, 17.0, 4.97 },
-    {  9, 59, 36.19, +29, 38, 43.1, 5.73 },
-    { 20, 53,  7.39, +29, 38, 57.8, 6.34 },
-    {  9,  8,   .10, +29, 39, 15.1, 5.43 },
-    {  8, 13,  8.90, +29, 39, 24.1, 5.64 },
-    {  1,  4, 27.60, +29, 39, 31.0, 6.19 },
-    { 18, 19, 52.10, +29, 39, 58.0, 5.99 },
-    {  2, 28, 10.01, +29, 40,  9.8, 5.29 },
-    {  6, 24, 52.61, +29, 42, 25.9, 6.71 },
-    { 14, 34, 40.80, +29, 44, 42.0, 4.46 },
-    {  0, 30,  7.30, +29, 45,  6.1, 5.23 },
-    { 23, 14, 21.70, +29, 46, 18.1, 6.41 },
-    { 20, 40, 36.19, +29, 48, 19.1, 6.08 },
-    { 16, 50, 39.00, +29, 48, 24.1, 5.72 },
-    { 18, 25, 58.80, +29, 49, 44.0, 5.83 },
-    { 16,  1, 26.59, +29, 51,  4.0, 4.99 },
-    { 18, 20, 57.10, +29, 51, 32.0, 5.63 },
-    { 20,  3, 37.39, +29, 53, 48.1, 5.71 },
-    { 21, 14, 10.30, +29, 54,  4.0, 6.17 },
-    { 19,  5, 47.11, +29, 55, 18.1, 6.31 },
-    {  2, 28, 48.50, +29, 55, 54.8, 5.89 },
-    {  6, 44, 12.10, +29, 56, 42.0,      },
-    {  9, 43, 33.29, +29, 58, 27.8, 5.64 },
-    { 15, 36, 53.40, +29, 59, 28.0, 6.52 },
-    {  1, 41, 39.19, +30,  2, 49.9, 5.99 },
-    { 21, 36, 13.90, +30,  3, 20.2, 6.36 },
-    {  1, 12, 59.50, +30,  3, 51.1, 6.19 },
-    {  1, 11, 39.60, +30,  5, 22.9, 4.51 },
-    { 19, 39, 22.61, +30,  9, 11.9, 4.69 },
-    { 21, 49, 50.69, +30, 10, 27.1, 5.04 },
-    {  2, 20,  4.39, +30, 11, 17.9, 6.47 },
-    { 17, 58, 30.19, +30, 11, 21.8, 4.41 },
-    { 19, 55,  6.50, +30, 11, 43.1, 6.57 },
-    { 21,  8, 38.90, +30, 12, 20.9, 5.59 },
-    {  5, 27,  8.30, +30, 12, 31.0, 5.74 },
-    { 22, 43,   .10, +30, 13, 17.0, 2.94 },
-    { 21, 12, 56.21, +30, 13, 36.8, 3.20 },
-    {  8, 57, 58.70, +30, 14,  1.0, 6.29 },
-    {  7, 11,  8.40, +30, 14, 43.1, 4.41 },
-    { 12, 18, 31.61, +30, 14, 57.1, 6.23 },
-    { 15, 23, 12.31, +30, 17, 16.1, 6.08 },
-    { 15, 23, 12.31, +30, 17, 16.1, 5.58 },
-    {  2, 12, 22.30, +30, 18, 11.2, 4.94 },
-    { 21, 22, 41.90, +30, 18, 34.9, 6.05 },
-    { 20, 38, 59.50, +30, 20,  3.8, 5.68 },
-    {  4, 28, 51.89, +30, 21, 41.0, 6.40 },
-    { 20, 29, 23.71, +30, 22,  7.0, 4.01 },
-    { 14, 31, 49.80, +30, 22, 17.0, 3.58 },
-    { 23, 20, 49.61, +30, 24, 54.0, 5.59 },
-    { 14, 20,  8.71, +30, 25, 45.1, 6.44 },
-    {  5, 31, 59.10, +30, 26, 45.0,      },
-    { 18,  9, 10.20, +30, 28,  9.8, 6.38 },
-    {  5, 38, 38.11, +30, 29, 33.0, 5.40 },
-    {  6, 28, 34.10, +30, 29, 35.2, 5.55 },
-    {  5,  4, 14.50, +30, 29, 40.9, 6.14 },
-    { 19, 15, 24.79, +30, 31, 35.0, 5.85 },
-    { 22, 10, 51.60, +30, 33, 11.2, 6.32 },
-    { 18, 32, 49.90, +30, 33, 15.1, 5.48 },
-    {  3, 15, 20.50, +30, 33, 24.1, 5.52 },
-    { 18,  7,  1.51, +30, 33, 42.8, 5.04 },
-    {  8, 54, 14.69, +30, 34, 45.8, 5.39 },
-    { 19, 43,  9.50, +30, 40, 43.0, 6.05 },
-    { 10, 45, 51.89, +30, 40, 55.9, 5.24 },
-    {  8, 45, 21.41, +30, 41, 52.1, 6.13 },
-    { 20, 45, 39.70, +30, 43, 10.9, 4.22 },
-    { 19,  4, 58.30, +30, 43, 59.9, 6.06 },
-    { 13,  0, 16.51, +30, 47,  6.0, 4.90 },
-    { 17, 36, 36.70, +30, 47,  7.1, 6.02 },
-    { 18, 40,  1.99, +30, 50, 57.8, 6.36 },
-    {  0, 39, 19.70, +30, 51, 38.9, 3.27 },
-    { 16, 22,  5.81, +30, 53, 30.8, 4.85 },
-    { 18, 33, 23.11, +30, 53, 33.0, 6.59 },
-    { 17,  0, 17.40, +30, 55, 35.0, 3.92 },
-    {  0, 20, 24.41, +30, 56,  8.9, 5.90 },
-    {  7, 18,  4.10, +30, 57, 20.9, 6.24 },
-    {  7, 35,  8.69, +30, 57, 40.0, 5.33 },
-    {  9, 10, 38.71, +30, 57, 47.2, 5.95 },
-    { 22, 41, 31.39, +30, 57, 56.9, 6.34 },
-    { 19, 58, 37.99, +30, 59,  1.0, 5.49 },
-    { 13, 40, 15.60, +31,  0, 42.8, 6.21 },
-    { 19, 18,   .79, +31,  1, 19.9, 6.68 },
-    {  6,  1, 10.20, +31,  2,  4.9, 5.98 },
-    {  3, 55, 22.99, +31,  2, 44.9, 6.10 },
-    { 23,  0, 42.50, +31,  4, 59.2, 6.60 },
-    {  5, 24, 38.50, +31,  8, 35.2, 5.94 },
-    { 17, 30, 55.39, +31,  9, 29.9, 5.61 },
-    {  9, 36, 42.91, +31,  9, 42.1, 5.56 },
-    {  3, 52,  4.30, +31, 10,  5.9, 6.25 },
-    { 21,  6, 30.31, +31, 11,  4.9, 5.82 },
-    { 13, 48, 38.71, +31, 11, 25.1, 5.62 },
-    { 17, 39, 57.50, +31, 12,  9.0, 6.03 },
-    {  5, 24, 38.30, +31, 13, 26.0, 6.28 },
-    { 20, 22, 37.39, +31, 15, 54.0, 6.09 },
-    {  9, 41, 35.21, +31, 16, 41.2, 5.89 },
-    { 19, 11, 46.01, +31, 16, 59.9, 5.98 },
-    { 15, 30, 22.70, +31, 17, 10.0, 6.46 },
-    { 17, 40, 41.21, +31, 17, 15.0, 6.28 },
-    { 23, 33, 57.19, +31, 19, 31.1, 4.98 },
-    {  5, 40, 35.90, +31, 21, 29.2, 6.04 },
-    { 15, 32, 55.80, +31, 21, 33.1, 4.14 },
-    { 18, 11, 54.19, +31, 24, 19.1, 4.97 },
-    {  1, 11,  6.79, +31, 25, 28.9, 5.16 },
-    {  4, 49, 12.79, +31, 26, 13.9, 5.58 },
-    {  4, 26,  6.31, +31, 26, 20.0, 5.28 },
-    { 10, 15,  6.29, +31, 28,  5.2, 6.46 },
-    { 17, 45, 40.30, +31, 30, 16.9, 6.23 },
-    {  0, 18, 38.30, +31, 31,  1.9, 5.87 },
-    { 20, 37, 32.59, +31, 31, 18.8, 6.49 },
-    {  2, 11, 25.01, +31, 31, 35.0, 6.23 },
-    { 11, 18, 10.90, +31, 31, 45.1, 4.87 },
-    { 11, 18, 10.99, +31, 31, 45.1, 4.41 },
-    {  0, 15,  7.01, +31, 32,  8.9, 6.45 },
-    { 20, 37, 31.80, +31, 34, 21.0, 6.32 },
-    { 16, 41, 17.21, +31, 36, 11.2, 2.81 },
-    { 10,  8, 15.91, +31, 36, 15.1, 6.24 },
-    {  2, 36, 42.89, +31, 36, 27.0, 6.10 },
-    { 18, 41, 41.30, +31, 37,  4.1, 6.41 },
-    { 18, 49, 43.99, +31, 37, 45.1, 6.64 },
-    { 10, 42, 11.30, +31, 41, 48.8, 6.02 },
-    {  5, 54, 58.99, +31, 42,  6.1, 5.90 },
-    { 16, 52, 58.10, +31, 42,  6.1, 5.32 },
-    { 15, 48,  1.99, +31, 44,  8.9, 6.44 },
-    { 19,  4, 57.89, +31, 44, 39.8, 5.56 },
-    {  1, 17, 24.10, +31, 44, 40.9, 6.73 },
-    { 11, 41, 34.30, +31, 44, 46.0, 5.73 },
-    { 18, 47, 57.50, +31, 45, 24.8, 6.06 },
-    { 23,  2, 33.10, +31, 46, 50.2, 6.57 },
-    {  7, 29,  6.70, +31, 47,  3.8, 4.18 },
-    { 15, 14,  6.10, +31, 47, 17.2, 5.99 },
-    { 14, 29, 49.70, +31, 47, 28.0, 6.06 },
-    {  2, 27, 27.70, +31, 48,  5.0, 5.54 },
-    {  1,  2, 49.10, +31, 48, 15.8, 5.50 },
-    { 23, 21, 54.91, +31, 48, 45.0, 5.32 },
-    { 22, 27, 46.20, +31, 50, 25.1, 5.98 },
-    {  3, 54,  7.90, +31, 53,  1.0, 2.85 },
-    { 17,  2, 17.21, +31, 53,  4.9, 6.36 },
-    {  7, 34, 36.00, +31, 53, 17.9, 1.98 },
-    {  7, 34, 36.00, +31, 53, 19.0, 2.88 },
-    {  5, 40, 42.10, +31, 55, 14.9, 6.11 },
-    { 10,  1,   .70, +31, 55, 25.0, 5.36 },
-    { 18, 43, 51.60, +31, 55, 36.1, 5.70 },
-    {  2, 57, 17.30, +31, 56,  3.1, 5.11 },
-    {  8, 40, 18.29, +31, 56, 30.8, 6.10 },
-    {  4, 20, 10.01, +31, 57, 11.9, 6.16 },
-    { 10, 38, 43.20, +31, 58, 34.0, 4.71 },
-    {  7, 39, 54.10, +32,  0, 34.9, 6.17 },
-    {  1,  8,  1.30, +32,  0, 43.9, 6.25 },
-    { 13, 56, 10.49, +32,  1, 57.0, 6.32 },
-    {  5, 51, 25.70, +32,  7, 30.0, 6.25 },
-    { 19,  0,   .91, +32,  8, 44.2, 4.93 },
-    {  3, 16, 35.11, +32, 11,  1.0, 6.06 },
-    { 20, 23, 51.70, +32, 11, 24.0, 4.43 },
-    {  1, 43, 49.99, +32, 11, 30.1, 6.34 },
-    {  5, 32, 43.70, +32, 11, 30.8, 4.76 },
-    {  3, 47, 48.91, +32, 11, 42.0, 6.25 },
-    { 20,  4, 36.10, +32, 13,  7.0, 5.64 },
-    { 21, 28,  8.30, +32, 13, 31.1, 5.80 },
-    { 18,  5, 49.61, +32, 13, 50.2, 5.71 },
-    {  9,  1, 24.10, +32, 15,  9.0, 5.82 },
-    { 11, 58,  7.20, +32, 16, 26.0, 6.42 },
-    {  3, 44, 19.10, +32, 17, 17.9, 3.83 },
-    { 14, 11, 15.10, +32, 17, 44.2, 6.11 },
-    { 14, 55, 58.70, +32, 18,  1.1, 6.12 },
-    { 20, 41,  2.59, +32, 18, 25.9, 5.51 },
-    {  5,  4, 36.89, +32, 19, 13.1, 6.62 },
-    { 16, 22, 56.50, +32, 19, 59.2, 6.40 },
-    {  9,  4, 55.20, +32, 22, 36.8, 6.46 },
-    { 10, 31, 51.41, +32, 22, 45.8, 5.90 },
-    { 23, 58, 49.20, +32, 22, 54.1, 6.52 },
-    { 23, 24, 50.81, +32, 23,  6.0, 5.57 },
-    {  7,  1, 17.21, +32, 24, 51.8, 6.59 },
-    {  8, 59, 32.59, +32, 25,  7.0, 5.20 },
-    { 19, 42, 44.59, +32, 25, 36.1, 5.94 },
-    { 21, 20, 50.09, +32, 27, 10.1, 5.68 },
-    {  6, 32, 27.19, +32, 27, 16.9, 5.87 },
-    {  4, 30, 38.30, +32, 27, 29.2, 6.21 },
-    { 17, 20, 39.60, +32, 28,  4.1, 5.39 },
-    {  8, 52, 34.61, +32, 28, 27.1, 5.66 },
-    { 19,  7, 25.61, +32, 30,  6.1, 5.23 },
-    { 15, 19, 30.19, +32, 30, 55.1, 6.32 },
-    { 15, 43, 59.30, +32, 30, 56.9, 5.56 },
-    { 23, 23, 47.50, +32, 31, 53.0, 6.69 },
-    { 14, 34, 11.71, +32, 32,  3.8, 6.33 },
-    {  9,  8,  4.10, +32, 32, 26.2, 6.50 },
-    { 18, 49, 52.90, +32, 33,  2.9, 5.25 },
-    { 16, 50, 43.10, +32, 33, 13.0, 6.13 },
-    {  6, 27, 35.50, +32, 33, 47.2, 6.43 },
-    { 22, 30,  1.80, +32, 34, 21.0, 5.65 },
-    {  4, 49, 19.01, +32, 35, 17.9, 5.86 },
-    {  6, 49, 41.30, +32, 36, 24.1, 5.71 },
-    { 21, 21, 22.01, +32, 36, 46.1, 6.04 },
-    {  6,  2, 55.10, +32, 38,  8.9, 6.24 },
-    {  5, 15, 24.41, +32, 41, 16.1, 5.02 },
-    { 18, 58, 56.59, +32, 41, 21.8, 3.24 },
-    {  1, 48, 41.59, +32, 41, 25.1, 5.79 },
-    {  6, 12, 20.09, +32, 41, 35.9, 5.78 },
-    { 17, 38, 49.70, +32, 44, 21.8, 6.37 },
-    { 14, 45, 13.70, +32, 47, 17.9, 6.28 },
-    {  5, 33, 27.50, +32, 48,  4.0, 6.48 },
-    {  8, 38, 19.01, +32, 48,  6.8, 5.94 },
-    { 18, 49, 45.91, +32, 48, 46.1, 5.91 },
-    { 23,  7, 27.70, +32, 49, 32.9, 6.02 },
-    { 20, 52,   .31, +32, 50, 57.1, 6.44 },
-    {  3, 15, 46.99, +32, 51, 23.0, 6.31 },
-    {  4, 43, 48.29, +32, 51, 55.1, 6.45 },
-    { 19, 46, 34.99, +32, 53, 19.0, 6.18 },
-    {  2, 37,  6.41, +32, 53, 30.8, 6.25 },
-    { 18, 57,  1.61, +32, 54,  5.0, 5.22 },
-    {  9, 21, 27.19, +32, 54,  6.8, 6.16 },
-    { 23, 36, 30.50, +32, 54, 15.1, 6.35 },
-    {  8, 56, 56.59, +32, 54, 37.1, 5.45 },
-    {  0, 20, 45.50, +32, 54, 41.0, 5.79 },
-    { 19, 50, 33.89, +32, 54, 51.1, 4.23 },
-    { 15, 21, 48.60, +32, 56,  2.0, 5.37 },
-    { 22,  4, 34.39, +32, 56, 30.8, 6.38 },
-    { 22,  0, 26.81, +33,  0, 22.0, 6.46 },
-    {  6, 33, 42.70, +33,  1, 27.1, 6.42 },
-    { 12, 16, 30.10, +33,  3, 41.0, 5.00 },
-    {  3, 49, 32.59, +33,  5, 29.0, 5.11 },
-    { 11, 18, 28.70, +33,  5, 39.1, 3.48 },
-    { 17, 17, 19.49, +33,  6,   .0, 4.82 },
-    {  1, 16, 18.79, +33,  6, 52.9, 6.02 },
-    {  4, 56, 59.59, +33,  9, 58.0, 2.69 },
-    { 11, 59, 17.59, +33, 10,  3.0, 5.96 },
-    { 22,  9, 13.61, +33, 10, 19.9, 5.58 },
-    { 22,  9, 59.21, +33, 10, 41.9, 4.29 },
-    {  0, 14,  2.30, +33, 12, 22.0, 6.25 },
-    { 18,  0, 36.41, +33, 12, 50.0, 5.99 },
-    { 19, 23, 34.01, +33, 13, 19.9, 6.37 },
-    {  7, 51,  2.30, +33, 14,  1.0, 6.03 },
-    { 12, 33, 38.90, +33, 14, 51.0, 5.42 },
-    {  5, 26, 51.31, +33, 15, 46.1, 6.15 },
-    {  2,  2, 58.01, +33, 17,  2.0, 5.50 },
-    {  8, 50, 32.21, +33, 17,  7.1, 6.25 },
-    { 16,  1,  2.69, +33, 18, 13.0, 5.41 },
-    { 18,  1, 35.90, +33, 18, 41.0, 6.15 },
-    { 15, 15, 30.19, +33, 18, 52.9, 3.47 },
-    { 16, 11, 39.70, +33, 20, 33.0, 6.29 },
-    {  2, 15, 56.21, +33, 21, 32.0, 5.28 },
-    { 18, 50,  4.80, +33, 21, 46.1, 3.45 },
-    {  5, 18, 10.70, +33, 22, 18.1, 4.54 },
-    { 11, 51,  9.41, +33, 22, 30.0, 6.27 },
-    { 12, 33, 47.40, +33, 23,  4.9, 6.24 },
-    { 19, 19,  3.79, +33, 23, 20.0, 6.60 },
-    {  7, 47, 30.31, +33, 24, 56.2, 5.14 },
-    { 19, 48, 50.59, +33, 26, 13.9, 6.44 },
-    { 20, 53, 53.90, +33, 26, 16.1, 5.47 },
-    { 18, 11, 45.10, +33, 26, 48.8, 5.88 },
-    { 11, 26, 25.49, +33, 27,  2.2, 6.32 },
-    { 18, 36, 37.20, +33, 28,  8.0, 5.42 },
-    { 23, 34, 38.21, +33, 29, 49.9, 5.63 },
-    { 10, 55, 44.40, +33, 30, 24.8, 5.03 },
-    { 19, 22, 33.41, +33, 31,  5.2, 6.06 },
-    { 12, 54, 13.10, +33, 32,  3.8, 6.26 },
-    {  3, 24, 29.69, +33, 32,  8.9, 5.61 },
-    {  5, 37, 45.70, +33, 33, 33.1, 6.33 },
-    { 17,  1, 36.41, +33, 34,  5.9, 5.25 },
-    {  0, 31, 25.61, +33, 34, 54.1, 5.87 },
-    {  4, 10, 58.99, +33, 35, 12.1, 5.72 },
-    {  6,  5, 34.01, +33, 35, 57.1, 6.23 },
-    {  3, 47, 52.61, +33, 36,   .0, 6.57 },
-    { 19,  1, 48.31, +33, 37, 17.0, 6.39 },
-    { 11, 38, 32.21, +33, 37, 32.2, 6.27 },
-    {  9, 30, 43.20, +33, 39, 20.2, 5.85 },
-    {  6, 57,   .50, +33, 40, 52.0, 5.89 },
-    { 16, 22, 29.21, +33, 42, 13.0, 5.39 },
-    { 10, 24,  8.59, +33, 43,  7.0, 5.50 },
-    {  0, 36, 52.90, +33, 43,  9.8, 4.36 },
-    { 23, 59, 29.21, +33, 43, 27.8, 6.58 },
-    { 23, 59, 29.21, +33, 43, 27.8, 6.58 },
-    { 19, 46, 25.61, +33, 43, 40.1, 4.99 },
-    { 20, 15, 23.71, +33, 43, 45.8, 5.66 },
-    {  5, 19,   .00, +33, 44, 53.9, 5.41 },
-    {  5, 18, 18.91, +33, 46,  1.9, 6.14 },
-    { 10, 25, 54.89, +33, 47, 46.0, 4.74 },
-    { 16, 22, 21.41, +33, 47, 57.1, 5.20 },
-    { 19,  0, 55.20, +33, 48,  7.9, 6.01 },
-    {  3, 28, 20.81, +33, 48, 27.0, 5.61 },
-    {  7,  8, 13.30, +33, 49, 55.9, 6.28 },
-    {  2, 30, 16.61, +33, 50,  2.0, 6.25 },
-    {  2, 17, 18.91, +33, 50, 49.9, 4.01 },
-    { 16, 14, 40.80, +33, 51, 29.9, 6.66 },
-    { 16, 14, 40.80, +33, 51, 31.0, 5.64 },
-    {  9,  8, 51.10, +33, 52, 55.9, 5.93 },
-    { 10, 23,  6.29, +33, 54, 29.2, 5.90 },
-    {  5, 52, 40.10, +33, 55,  3.0, 5.98 },
-    {  0, 58, 14.21, +33, 57,  2.9, 5.98 },
-    {  5, 20,   .91, +33, 57, 29.2, 5.03 },
-    {  4, 24, 37.39, +33, 57, 34.9, 5.76 },
-    {  6, 52, 47.30, +33, 57, 40.0, 3.60 },
-    {  3, 42, 22.51, +33, 57, 54.0, 4.97 },
-    { 18, 54, 52.51, +33, 58,  7.0, 6.02 },
-    { 20, 46, 12.70, +33, 58, 13.1, 2.46 },
-    { 19, 39, 45.00, +33, 58, 45.1, 6.10 },
-    {  5, 19, 23.59, +33, 59,  8.2, 6.49 },
-    {  7, 42, 43.51, +34,  0,  1.1, 6.02 },
-    {  7,  7, 22.30, +34,  0, 33.8, 5.91 },
-    { 10, 54, 58.20, +34,  2,  4.9, 5.72 },
-    { 11, 59, 57.19, +34,  2,  6.0, 6.50 },
-    { 16, 43, 51.70, +34,  2, 20.0, 5.99 },
-    { 13, 18, 27.79, +34,  5, 53.2, 5.82 },
-    {  4, 24, 29.21, +34,  7, 50.2, 5.73 },
-    { 19, 43, 51.41, +34,  9, 45.0, 6.05 },
-    { 11, 41,  3.00, +34, 12,  6.1, 5.33 },
-    { 10, 53, 18.70, +34, 12, 54.0, 3.83 },
-    {  3, 18, 43.80, +34, 13, 22.1, 4.82 },
-    {  2, 17,  3.19, +34, 13, 27.1, 4.87 },
-    {  1, 23, 37.49, +34, 14, 44.9, 6.29 },
-    {  2, 37,  2.50, +34, 15, 50.0, 5.30 },
-    { 17, 32,  1.10, +34, 16, 14.9, 6.56 },
-    {  5, 16, 18.19, +34, 18, 42.8, 5.96 },
-    { 20, 27,  7.70, +34, 19, 44.0, 6.39 },
-    { 15, 26, 17.40, +34, 20,  8.9, 5.46 },
-    {  3, 51, 53.71, +34, 21, 33.1, 5.77 },
-    { 20, 47, 10.80, +34, 22, 27.1, 4.92 },
-    {  1, 27,  6.19, +34, 22, 39.0, 6.27 },
-    {  5, 26, 48.91, +34, 23, 30.1, 5.94 },
-    {  9, 21,  3.29, +34, 23, 33.0, 3.13 },
-    { 19, 44, 38.21, +34, 24, 50.0, 6.57 },
-    { 20,  7, 41.40, +34, 25, 23.2, 6.11 },
-    { 13, 51, 47.50, +34, 26, 39.1, 4.74 },
-    { 19, 31, 46.30, +34, 27, 11.2, 4.74 },
-    { 18, 35, 13.49, +34, 27, 28.1, 6.10 },
-    {  7,  6, 11.59, +34, 28, 26.0, 5.55 },
-    {  5, 27, 38.90, +34, 28, 32.9, 5.07 },
-    {  2, 32, 52.51, +34, 32, 33.0, 5.83 },
-    { 15,  3, 36.50, +34, 33, 58.0, 6.59 },
-    {  4, 20, 24.60, +34, 34,   .1, 4.93 },
-    {  1, 26,  8.69, +34, 34, 46.9, 6.31 },
-    {  7, 39,  9.91, +34, 35,  3.1, 4.90 },
-    { 19,  9,  4.39, +34, 36,  2.2, 6.74 },
-    { 22, 12, 47.81, +34, 36, 16.9, 5.33 },
-    {  9, 15, 14.30, +34, 38,  1.0, 5.97 },
-    {  0,  4, 53.81, +34, 39, 34.9, 6.12 },
-    { 13, 51,  9.19, +34, 39, 51.8, 5.87 },
-    { 15, 38, 48.91, +34, 40, 30.0, 6.11 },
-    {  2, 35, 46.80, +34, 41, 15.0, 5.35 },
-    {  3, 16,  1.90, +34, 41, 19.0, 6.25 },
-    { 17, 26, 46.20, +34, 41, 44.9, 5.94 },
-    {  5, 33, 37.99, +34, 43, 32.9, 6.27 },
-    { 18, 42,  8.11, +34, 44, 48.1, 6.47 },
-    { 13, 51,  4.51, +34, 46, 21.0, 6.65 },
-    { 17,  3, 53.50, +34, 47, 25.1, 6.04 },
-    { 23, 19, 27.41, +34, 47, 35.9, 6.32 },
-    {  1, 32,  7.61, +34, 48,   .0, 6.39 },
-    {  3, 58,  3.10, +34, 48, 51.8, 6.53 },
-    {  5, 25, 13.01, +34, 51, 19.1, 6.55 },
-    { 21, 17, 55.10, +34, 53, 48.8, 4.43 },
-    { 11, 49, 41.71, +34, 55, 54.1, 5.70 },
-    { 23, 32, 24.60, +34, 57,  9.0, 6.65 },
-    { 20, 18, 39.10, +34, 58, 58.1, 5.17 },
-    {  2,  9, 32.59, +34, 59, 13.9, 3.00 },
-    { 10, 33, 30.91, +34, 59, 19.0, 5.58 },
-    { 13, 42, 43.39, +34, 59, 20.0, 5.98 },
-    {  8, 25,  4.90, +35,  0, 41.0, 6.06 },
-    { 19, 45, 51.41, +35,  0, 46.1, 6.09 },
-    {  7, 38, 32.81, +35,  2, 55.0, 5.56 },
-    {  2, 51, 30.79, +35,  3, 34.9, 4.53 },
-    {  3, 56, 28.70, +35,  4, 52.0, 5.49 },
-    { 19, 56, 18.41, +35,  4, 59.9, 3.89 },
-    {  9, 42, 42.70, +35,  5, 35.9, 6.14 },
-    {  9, 31, 32.40, +35,  6, 11.2, 5.37 },
-    { 13, 19,  4.20, +35,  7, 41.2, 6.02 },
-    {  2, 59,  3.70, +35, 10, 59.2, 4.93 },
-    { 19, 20, 33.10, +35, 11, 10.0, 6.31 },
-    { 15,  3,  6.10, +35, 12, 20.9, 5.51 },
-    { 16, 31,  2.81, +35, 13, 30.0, 6.25 },
-    { 10,  7, 25.80, +35, 14, 40.9, 4.48 },
-    {  1, 42,  3.50, +35, 14, 44.2, 5.64 },
-    { 20, 33, 54.19, +35, 15,  2.9, 4.61 },
-    { 19, 48, 43.90, +35, 18, 41.0, 6.53 },
-    {  9, 18, 25.99, +35, 21, 51.1, 5.75 },
-    {  6,  6,  8.50, +35, 23, 15.0, 6.12 },
-    {  0, 37, 21.10, +35, 23, 57.8, 5.48 },
-    {  7, 55, 40.80, +35, 24, 46.1, 6.23 },
-    {  8,  1, 55.10, +35, 24, 47.2, 6.34 },
-    { 17,  3, 30.19, +35, 24, 51.1, 6.69 },
-    { 20, 42, 22.20, +35, 27, 22.0, 6.66 },
-    {  5, 26, 54.29, +35, 27, 25.9, 6.15 },
-    {  3, 32, 40.01, +35, 27, 42.1, 5.90 },
-    { 14, 17, 59.81, +35, 30, 33.8, 4.81 },
-    { 21, 42,  1.10, +35, 30, 37.1, 6.07 },
-    {  8, 53, 55.70, +35, 32, 17.9, 6.14 },
-    {  2, 47,  3.50, +35, 33, 18.0, 6.30 },
-    { 22, 36,  7.90, +35, 34, 37.9, 6.10 },
-    { 20, 43, 24.19, +35, 35, 16.1, 6.47 },
-    {  1,  9, 43.90, +35, 37, 14.2, 2.06 },
-    { 22, 36, 48.70, +35, 39,  9.0, 6.30 },
-    { 15, 51, 13.90, +35, 39, 27.0, 4.82 },
-    { 22, 29, 43.90, +35, 43, 32.2, 6.56 },
-    {  6, 53,  3.41, +35, 47, 19.0, 6.01 },
-    {  3, 58, 57.89, +35, 47, 28.0, 4.04 },
-    { 13,  5, 44.50, +35, 47, 56.0, 5.25 },
-    {  8, 58, 27.50, +35, 48,  9.0, 6.51 },
-    {  9, 35, 39.60, +35, 48, 37.1, 5.41 },
-    { 11, 12, 32.21, +35, 48, 49.0, 6.41 },
-    { 21, 45, 44.50, +35, 51, 25.9, 6.40 },
-    {  6, 41, 37.70, +35, 55, 54.8, 6.46 },
-    { 17,  8,  1.99, +35, 56,  7.1, 5.39 },
-    {  5,  6,   .91, +35, 56, 11.0, 6.52 },
-    { 12, 39, 16.90, +35, 57,  6.8, 6.45 },
-    { 20,  6, 21.79, +35, 58, 21.0, 5.36 },
-    {  2, 46, 58.30, +35, 59,  1.0, 6.25 },
-    { 21,  1, 12.89, +36,  1, 34.0, 5.97 },
-    { 12,  1, 39.50, +36,  2, 30.8, 5.59 },
-    { 18, 19, 51.70, +36,  3, 51.8, 4.33 },
-    { 19, 45, 39.60, +36,  5, 28.0, 6.43 },
-    { 10, 59, 32.81, +36,  5, 35.2, 6.00 },
-    { 19,  7, 18.10, +36,  6,  1.1, 5.28 },
-    {  6, 44, 12.60, +36,  6, 34.9, 6.31 },
-    {  2, 32,  6.19, +36,  8, 49.9, 5.15 },
-    {  6, 15, 39.00, +36,  8, 55.0, 6.92 },
-    {  4, 56, 19.90, +36, 10,  8.0, 6.07 },
-    { 14, 28, 16.39, +36, 11, 48.8, 6.10 },
-    { 19, 30, 46.90, +36, 13, 43.0, 6.25 },
-    { 19, 56, 44.21, +36, 15,  2.9, 6.02 },
-    { 17, 58, 42.29, +36, 17, 16.1, 6.00 },
-    { 13, 37, 27.60, +36, 17, 42.0, 4.82 },
-    { 21, 11,  3.89, +36, 17, 57.1, 6.54 },
-    { 11,  9, 19.10, +36, 18, 33.8, 5.74 },
-    { 19, 26,  9.10, +36, 19,  4.1, 5.15 },
-    { 10, 36, 21.41, +36, 19, 36.8, 6.28 },
-    { 22, 55, 44.50, +36, 21,  6.1, 5.74 },
-    {  9, 34, 13.39, +36, 23, 51.0, 4.55 },
-    { 18,  8,  2.21, +36, 24,  5.0, 5.48 },
-    {  8, 34, 43.80, +36, 25,  9.8, 5.78 },
-    { 16, 11, 48.00, +36, 25, 30.0, 5.63 },
-    { 23, 49, 40.99, +36, 25, 31.1, 5.90 },
-    { 19, 52, 16.30, +36, 25, 55.9, 6.10 },
-    {  8, 33, 21.79, +36, 26, 11.0, 6.24 },
-    { 19, 24,  6.10, +36, 27,  6.8, 6.36 },
-    { 20, 29, 20.40, +36, 27, 16.9, 5.88 },
-    { 15,  6, 35.11, +36, 27, 20.2, 6.35 },
-    {  3, 44, 31.39, +36, 27, 36.0, 5.59 },
-    { 18,  9, 58.99, +36, 27, 59.0, 5.58 },
-    {  9, 33, 30.31, +36, 29, 12.8, 6.18 },
-    { 20, 47, 24.50, +36, 29, 26.9, 4.53 },
-    { 16,  8, 58.30, +36, 29, 26.9, 4.76 },
-    { 18, 51, 36.50, +36, 32, 19.0, 6.09 },
-    { 18, 43, 36.10, +36, 33, 24.1, 6.01 },
-    { 21, 48,  8.30, +36, 34, 50.2, 6.47 },
-    {  9, 24, 22.51, +36, 35, 12.8, 6.67 },
-    { 20, 14,  4.99, +36, 36, 19.1, 6.45 },
-    { 15, 31, 22.39, +36, 36, 59.0, 6.38 },
-    { 14, 34, 38.50, +36, 37, 32.9, 6.03 },
-    {  0,  8, 40.99, +36, 37, 36.1, 6.19 },
-    { 16,  3, 19.39, +36, 37, 54.1, 5.83 },
-    { 13, 49, 45.00, +36, 37, 58.1, 6.38 },
-    { 21, 13, 26.30, +36, 38,  1.0, 6.05 },
-    { 15, 39, 22.70, +36, 38,  8.9, 5.07 },
-    { 15, 39, 22.20, +36, 38, 12.1, 6.00 },
-    { 15, 58, 57.70, +36, 38, 38.0, 5.62 },
-    { 21, 25, 46.99, +36, 40,  3.0, 5.94 },
-    {  4, 52, 37.99, +36, 42, 11.2, 4.78 },
-    { 10, 27, 52.99, +36, 42, 25.9, 4.21 },
-    { 23, 40, 40.61, +36, 43, 14.9, 6.23 },
-    { 11, 55, 14.09, +36, 45, 23.0, 6.49 },
-    {  7, 22,  2.59, +36, 45, 38.2, 5.13 },
-    {  0, 18, 19.70, +36, 47,  7.1, 4.52 },
-    {  9, 18, 50.69, +36, 48,  9.0, 3.82 },
-    { 15, 30, 27.91, +36, 48, 15.1, 6.37 },
-    { 20, 14, 31.99, +36, 48, 23.0, 4.97 },
-    { 17, 15,  2.81, +36, 48, 33.1, 3.16 },
-    { 11, 33, 56.30, +36, 48, 56.2, 6.40 },
-    { 20,  9, 25.61, +36, 50, 22.9, 4.93 },
-    { 18, 54, 30.19, +36, 53, 56.0, 4.30 },
-    {  0, 28, 56.59, +36, 54,   .0, 6.26 },
-    {  8, 44, 10.10, +36, 55,  5.2, 6.33 },
-    { 20, 30, 59.21, +36, 56,  8.9, 6.19 },
-    { 19, 35, 48.31, +36, 56, 39.8, 6.05 },
-    { 17, 24, 27.10, +36, 57,  6.8, 6.28 },
-    { 14, 33, 20.30, +36, 57, 33.8, 6.43 },
-    { 18, 53, 43.61, +36, 58, 18.1, 5.58 },
-    {  4,  1, 14.69, +36, 59, 24.0, 6.41 },
-    { 19, 54, 48.31, +36, 59, 46.0, 5.76 },
-    { 20, 18, 28.61, +37,  0,   .0, 5.58 },
-    { 13, 23, 54.00, +37,  2,  2.0, 6.07 },
-    { 19, 59, 55.20, +37,  2, 34.1, 5.19 },
-    { 20, 16, 28.20, +37,  3, 23.0, 6.48 },
-    { 22, 55,  2.59, +37,  4, 36.8, 5.91 },
-    { 20,  1, 15.31, +37,  5, 56.0, 6.20 },
-    { 21, 27, 21.41, +37,  7,   .1, 5.31 },
-    {  1, 54, 57.50, +37,  7, 41.9, 6.26 },
-    { 20, 19, 48.31, +37,  7, 57.0, 6.57 },
-    { 17, 23, 40.99, +37,  8, 44.9, 4.52 },
-    { 17, 23, 40.70, +37,  8, 48.1, 5.47 },
-    {  6, 43, 13.80, +37,  8, 48.8, 6.19 },
-    { 13, 34, 47.81, +37, 10, 57.0, 4.98 },
-    {  5, 59, 43.30, +37, 12, 45.0, 2.62 },
-    {  1, 34, 16.61, +37, 14, 13.9, 5.88 },
-    { 17, 56, 15.19, +37, 15,  2.2, 3.86 },
-    {  1, 56,  9.29, +37, 15,  6.1, 5.67 },
-    {  8, 31, 19.90, +37, 15, 56.9, 6.18 },
-    { 14, 50, 29.59, +37, 16, 18.8, 5.48 },
-    {  1, 55, 54.41, +37, 16, 40.1, 5.89 },
-    { 17, 17, 40.30, +37, 17, 30.1, 4.65 },
-    { 17, 35, 42.41, +37, 18,  6.1, 6.10 },
-    {  5, 10, 18.91, +37, 18,  6.8, 6.02 },
-    {  5, 51,  2.40, +37, 18, 20.2, 4.74 },
-    {  2, 35, 38.81, +37, 18, 43.9, 5.71 },
-    {  2, 49, 27.10, +37, 19, 34.0, 6.45 },
-    { 19, 19, 38.90, +37, 19, 50.2, 6.31 },
-    { 15, 24, 30.91, +37, 20, 52.1, 6.50 },
-    { 21, 23, 48.31, +37, 21,  5.0, 6.47 },
-    { 19, 44, 16.61, +37, 21, 15.8, 4.89 },
-    { 15, 24, 29.40, +37, 22, 37.9, 4.31 },
-    {  5, 24, 39.19, +37, 23,  8.2, 4.99 },
-    {  1, 18, 46.99, +37, 23, 10.0, 6.46 },
-    { 16, 25, 24.19, +37, 23, 38.0, 5.54 },
-    { 10, 11, 12.79, +37, 24,  6.8, 5.85 },
-    { 21, 23, 22.99, +37, 24, 24.1, 6.58 },
-    { 22, 48, 10.90, +37, 25,   .1, 5.90 },
-    {  0, 53, 28.20, +37, 25,  5.2, 6.06 },
-    { 13,  9, 38.71, +37, 25, 23.2, 6.02 },
-    { 22, 26, 45.70, +37, 26, 38.0, 6.46 },
-    {  7,  8, 36.31, +37, 26, 42.0, 6.16 },
-    { 19, 19,  1.20, +37, 26, 43.1, 6.22 },
-    { 20, 23, 44.40, +37, 28, 35.0, 5.90 },
-    {  4, 49, 54.60, +37, 29, 17.9, 4.88 },
-    { 12, 50, 10.70, +37, 31,   .8, 5.89 },
-    {  7, 46, 39.29, +37, 31,  3.0, 5.18 },
-    {  3, 41,  7.90, +37, 34, 48.0, 5.57 },
-    { 22, 39, 34.30, +37, 35, 34.1, 6.03 },
-    { 18, 44, 48.19, +37, 35, 39.8, 5.73 },
-    {  9,  0, 30.79, +37, 36, 15.8, 6.44 },
-    { 18, 44, 46.39, +37, 36, 18.0, 4.36 },
-    { 23, 40,  2.81, +37, 39,  9.0, 6.53 },
-    {  0, 12, 50.40, +37, 41, 35.9, 6.73 },
-    {  1, 23, 40.61, +37, 42, 54.0, 5.58 },
-    { 11, 52, 58.80, +37, 43,  7.0, 6.45 },
-    {  1, 11, 10.30, +37, 43, 27.1, 5.81 },
-    {  2, 38, 17.81, +37, 43, 36.1, 6.18 },
-    {  4,  8, 15.31, +37, 43, 40.1, 6.09 },
-    { 22, 15, 58.20, +37, 44, 56.0, 4.13 },
-    { 22, 18, 56.21, +37, 46,  9.8, 6.17 },
-    { 22, 42, 55.51, +37, 48, 10.1, 6.43 },
-    { 14, 49,  6.70, +37, 48, 40.0, 6.16 },
-    { 19, 50, 46.99, +37, 49, 35.0, 6.06 },
-    {  2,  8, 29.30, +37, 51, 33.1, 4.82 },
-    {  4, 59, 15.41, +37, 53, 25.1, 4.94 },
-    { 10, 39,  7.61, +37, 54, 36.0, 5.85 },
-    { 19, 27, 36.50, +37, 56, 28.0, 6.34 },
-    { 15, 55, 47.59, +37, 56, 48.8, 5.45 },
-    {  1, 48, 38.90, +37, 57, 10.1, 5.94 },
-    {  6,  5,  2.59, +37, 57, 51.1, 6.34 },
-    {  4, 13, 59.59, +37, 58,   .8, 6.45 },
-    {  0, 21,  7.30, +37, 58,  7.0, 5.18 },
-    {  8, 32, 55.01, +38,  0, 59.0, 5.90 },
-    { 23, 34, 46.70, +38,  1, 26.0, 6.18 },
-    { 20, 17, 47.21, +38,  1, 59.2, 4.81 },
-    {  4,  8, 36.60, +38,  2, 22.9, 5.51 },
-    { 21, 14, 47.50, +38,  2, 44.2, 3.72 },
-    {  6, 59,  2.81, +38,  3,  7.9, 6.00 },
-    {  2, 38, 27.79, +38,  5, 21.8, 6.30 },
-    { 19, 58, 34.39, +38,  6, 20.2, 6.32 },
-    {  3,  0, 11.81, +38,  7, 54.1, 6.11 },
-    { 19, 16, 22.10, +38,  8,  1.0, 4.36 },
-    { 23, 20, 53.30, +38, 10, 55.9, 5.77 },
-    { 11, 19,  7.90, +38, 11,  8.2, 4.78 },
-    {  9, 20, 59.30, +38, 11, 17.9, 6.12 },
-    { 21, 19, 22.20, +38, 14, 15.0, 5.83 },
-    { 11,  4, 31.20, +38, 14, 29.0, 6.00 },
-    { 15, 13, 35.59, +38, 15, 52.9, 6.20 },
-    { 18, 58,  1.90, +38, 15, 58.0, 5.89 },
-    {  4, 41, 50.30, +38, 16, 49.1, 5.99 },
-    { 21, 43, 25.70, +38, 17,  2.0, 5.65 },
-    { 14, 32,  4.70, +38, 18, 29.9, 3.03 },
-    { 12, 56,   .41, +38, 18, 52.9, 5.60 },
-    { 12, 56,  1.70, +38, 19,  5.9, 2.90 },
-    {  2, 50, 35.11, +38, 19,  7.0, 4.23 },
-    { 20, 37, 23.59, +38, 19, 43.0, 6.20 },
-    {  2, 53, 42.60, +38, 20, 15.0, 5.33 },
-    {  7, 40, 14.59, +38, 20, 39.8, 5.73 },
-    { 18, 40, 12.19, +38, 22,  1.9, 6.45 },
-    { 15, 35, 49.30, +38, 22, 26.0, 6.42 },
-    { 19, 36, 56.59, +38, 23,  2.0, 6.50 },
-    { 14, 25, 29.21, +38, 23, 35.2, 6.27 },
-    { 19, 47, 27.79, +38, 24, 27.0, 5.77 },
-    {  6, 53, 13.39, +38, 26, 17.2, 6.30 },
-    { 20, 27, 34.30, +38, 26, 25.1, 5.62 },
-    {  6, 36, 32.90, +38, 26, 43.1, 5.29 },
-    {  9,  6, 31.80, +38, 27,  7.9, 4.56 },
-    { 18,  9, 37.49, +38, 27, 27.0, 6.40 },
-    { 20,  5,  9.79, +38, 28, 41.9, 6.19 },
-    {  6,  6, 35.09, +38, 28, 58.1, 5.36 },
-    {  5, 13, 25.70, +38, 29,  3.8, 4.86 },
-    { 19, 55, 51.70, +38, 29, 12.1, 4.94 },
-    { 13, 10,  3.19, +38, 29, 56.0, 5.91 },
-    {  0, 56, 45.19, +38, 29, 57.8, 3.87 },
-    { 13, 46, 19.01, +38, 30, 14.0, 5.94 },
-    {  6, 53, 57.00, +38, 30, 18.0, 6.48 },
-    { 13,  9, 42.00, +38, 32,  2.0, 6.28 },
-    { 21, 34, 46.61, +38, 32,  3.1, 4.90 },
-    { 13, 46, 59.81, +38, 32, 34.1, 5.50 },
-    {  0, 52, 53.40, +38, 32, 55.0, 6.69 },
-    { 22, 23, 54.19, +38, 34, 25.0, 6.22 },
-    {  0, 24,  1.99, +38, 34, 37.9, 7.39 },
-    { 17, 24,  2.21, +38, 34, 58.1, 6.49 },
-    {  2, 58,  2.30, +38, 36, 54.0, 6.04 },
-    { 21, 22, 46.90, +38, 38,  3.1, 6.63 },
-    { 21, 48, 29.40, +38, 38, 55.0, 6.12 },
-    { 21,  3,  4.80, +38, 39, 27.0, 6.07 },
-    { 23, 30, 39.70, +38, 39, 42.8, 6.05 },
-    {  0, 17,  5.50, +38, 40, 54.1, 4.61 },
-    { 23,  0, 54.70, +38, 42, 29.2, 6.54 },
-    { 19, 49, 27.50, +38, 42, 36.0, 6.11 },
-    { 19, 50, 34.01, +38, 43, 21.0, 5.12 },
-    {  8, 11, 21.60, +38, 43, 53.0, 6.58 },
-    {  2, 36, 57.19, +38, 43, 58.1, 5.90 },
-    { 18, 23, 57.41, +38, 44, 21.1, 6.36 },
-    { 21,  6, 55.30, +38, 44, 35.9, 6.03 },
-    { 21,  6, 54.60, +38, 44, 44.9, 5.21 },
-    { 19, 33, 36.41, +38, 45, 43.9, 6.61 },
-    { 14, 18, 55.70, +38, 46,  3.0, 6.86 },
-    { 18, 13,  4.80, +38, 46, 25.0, 6.04 },
-    { 18, 36, 56.30, +38, 47,  1.0, 0.03 },
-    { 13, 34, 21.79, +38, 47, 21.1, 6.37 },
-    { 14, 19, 47.69, +38, 47, 38.0, 6.33 },
-    { 17, 18, 23.30, +38, 48, 41.0, 5.94 },
-    {  3, 59, 40.01, +38, 49, 14.2, 6.38 },
-    {  3, 58, 29.11, +38, 50, 25.1, 6.30 },
-    {  3,  5, 10.61, +38, 50, 25.1, 3.39 },
-    {  6, 53,  1.49, +38, 52,  9.1, 6.12 },
-    { 17, 45, 53.71, +38, 52, 53.0, 6.52 },
-    { 17, 30, 40.30, +38, 52, 55.9, 6.43 },
-    {  7, 31, 55.70, +38, 53, 47.0, 6.54 },
-    { 20, 16,  3.41, +38, 53, 52.1, 6.27 },
-    { 16, 42, 53.81, +38, 55, 19.9, 3.53 },
-    { 10, 30,  6.41, +38, 55, 31.1, 5.77 },
-    {  7, 22, 13.39, +38, 59, 46.0, 6.40 },
-    { 15, 35, 15.00, +39,  0, 36.0, 5.11 },
-    { 12, 25, 50.90, +39,  1,  7.0, 5.02 },
-    {  2, 10, 52.80, +39,  2, 21.8, 5.63 },
-    {  2, 10, 53.71, +39,  2, 35.2, 6.10 },
-    { 22, 39, 15.70, +39,  3,  1.1, 4.88 },
-    { 20, 41,   .41, +39,  4, 55.9, 6.51 },
-    { 19, 13, 45.50, +39,  8, 46.0, 4.39 },
-    {  5, 51, 29.40, +39,  8, 55.0, 3.97 },
-    {  5, 49, 10.49, +39, 10, 52.0, 4.52 },
-    { 11,  0, 50.40, +39, 12, 43.9, 5.08 },
-    { 18, 59, 12.29, +39, 13,  4.1, 6.41 },
-    { 23, 31, 17.40, +39, 14, 11.0, 5.22 },
-    { 14, 59, 36.89, +39, 15, 55.1, 5.64 },
-    { 12, 44, 59.50, +39, 16, 44.0, 5.95 },
-    {  3, 17, 45.79, +39, 16, 59.9, 5.96 },
-    { 18, 43, 16.70, +39, 18,  1.1, 6.45 },
-    { 22, 57, 40.70, +39, 18, 32.0, 6.18 },
-    {  7, 11, 39.29, +39, 19, 14.2, 4.90 },
-    { 17, 45, 58.49, +39, 19, 21.0, 6.68 },
-    { 11, 29,  4.20, +39, 20, 12.8, 5.31 },
-    {  6, 38, 39.50, +39, 23, 26.9, 5.69 },
-    {  5,  0, 18.29, +39, 23, 40.9, 5.95 },
-    { 21, 17, 25.01, +39, 23, 40.9, 4.23 },
-    { 20, 20, 15.19, +39, 24, 11.9, 6.23 },
-    {  0, 41,  7.20, +39, 27, 31.0, 5.33 },
-    { 22, 44,  5.21, +39, 27, 56.2, 5.95 },
-    { 18, 24, 13.80, +39, 30, 25.9, 5.12 },
-    { 21, 51,  4.90, +39, 32, 12.1, 6.17 },
-    { 13, 48, 57.19, +39, 32, 34.1, 7.40 },
-    {  5, 52, 39.50, +39, 34, 27.8, 6.45 },
-    { 15, 22, 37.39, +39, 34, 53.0, 5.50 },
-    {  3, 11, 17.40, +39, 36, 42.1, 4.63 },
-    { 18, 44, 22.90, +39, 36, 46.1, 5.37 },
-    { 18, 44, 22.90, +39, 36, 47.2, 5.14 },
-    {  9, 35,  3.79, +39, 37, 17.0, 4.81 },
-    { 22, 35, 52.30, +39, 38,  3.1, 5.73 },
-    {  5,  0, 23.21, +39, 39, 18.0, 6.58 },
-    {  2, 58, 45.70, +39, 39, 46.1, 4.70 },
-    {  2, 35, 27.89, +39, 39, 51.8, 6.36 },
-    { 18, 38,  6.50, +39, 40,  5.2, 6.04 },
-    { 18, 44, 20.40, +39, 40, 12.0, 5.06 },
-    { 18, 44, 20.30, +39, 40, 16.0, 6.02 },
-    { 15, 57, 29.90, +39, 41, 43.1, 6.31 },
-    { 16, 19, 55.10, +39, 42, 31.0, 5.46 },
-    {  9,  1, 40.61, +39, 42, 47.9, 6.36 },
-    { 22, 13, 52.70, +39, 42, 54.0, 4.49 },
-    { 14, 16, 24.19, +39, 44, 40.9, 6.38 },
-    {  9, 42,   .31, +39, 45, 28.1, 5.62 },
-    { 22, 32, 26.40, +39, 46, 46.9, 5.88 },
-    { 22, 27, 26.50, +39, 48, 34.9, 6.14 },
-    {  5, 30, 45.10, +39, 49, 32.9, 6.37 },
-    {  2, 19, 37.30, +39, 50,  6.0, 6.63 },
-    {  2, 37, 20.81, +39, 53, 44.9, 6.54 },
-    {  3, 33, 35.11, +39, 53, 57.8, 5.81 },
-    {  6, 38, 49.20, +39, 54,  9.0, 5.20 },
-    {  9, 35, 22.39, +39, 57, 47.9, 6.76 },
-    { 17, 21, 43.61, +39, 58, 27.8, 5.51 },
-    { 17, 52,  4.70, +39, 58, 55.9, 6.04 },
-    {  1,  4, 36.41, +39, 59, 28.0, 6.72 },
-    { 17, 53, 18.10, +40,  0, 29.2, 5.16 },
-    {  4, 31, 24.00, +40,  0, 37.1, 6.26 },
-    {  3, 57, 51.19, +40,  0, 37.1, 2.89 },
-    {  7, 37, 17.81, +40,  1, 31.1, 6.38 },
-    { 17, 51, 13.99, +40,  4, 21.0, 6.46 },
-    { 18,  4, 43.20, +40,  5,  3.1, 6.52 },
-    {  5, 19,  8.50, +40,  5, 57.1, 4.71 },
-    { 13, 20, 19.01, +40,  9,  2.2, 5.60 },
-    { 13, 13, 43.01, +40,  9, 10.1, 4.92 },
-    { 22, 53, 11.30, +40, 10,  1.9, 6.34 },
-    {  5, 36, 52.39, +40, 10, 55.9, 6.09 },
-    {  2, 42, 14.90, +40, 11, 38.0, 4.91 },
-    {  8, 56, 30.50, +40, 12,  6.1, 5.89 },
-    { 22, 41, 28.61, +40, 13, 32.2, 5.25 },
-    { 23, 34, 37.49, +40, 14, 11.0, 5.59 },
-    {  9, 38, 21.70, +40, 14, 22.9, 5.25 },
-    { 19, 41, 57.50, +40, 15, 14.0, 6.23 },
-    { 20, 22, 13.70, +40, 15, 24.1, 2.20 },
-    {  4, 46, 44.40, +40, 18, 46.1, 5.97 },
-    {  1, 27, 46.99, +40, 20,  8.2, 6.60 },
-    { 11, 57, 14.59, +40, 20, 37.0, 6.62 },
-    { 21, 21,  1.39, +40, 20, 44.2, 6.40 },
-    { 15, 37, 49.61, +40, 21, 11.9, 5.24 },
-    { 20, 16, 55.30, +40, 21, 54.0, 5.24 },
-    { 19, 57, 13.90, +40, 22,  5.2, 5.45 },
-    { 22, 54,  7.01, +40, 22, 36.8, 5.81 },
-    { 15,  1, 56.81, +40, 23, 26.2, 3.50 },
-    { 21, 36, 57.00, +40, 24, 49.0, 5.01 },
-    { 10, 33, 13.90, +40, 25, 32.2, 4.75 },
-    { 19, 11, 23.11, +40, 25, 45.1, 6.18 },
-    { 10, 59, 28.01, +40, 25, 49.1, 5.05 },
-    { 14, 43, 44.40, +40, 27, 33.1, 5.73 },
-    {  5, 18, 40.39, +40, 27, 54.0, 6.18 },
-    {  3, 17, 11.40, +40, 28, 59.9, 6.45 },
-    {  4, 14, 53.30, +40, 29,  1.0, 4.71 },
-    {  5, 45, 49.51, +40, 30, 25.9, 6.58 },
-    { 17,  7, 46.70, +40, 30, 58.0, 6.34 },
-    { 13, 17, 32.50, +40, 34, 21.0, 4.73 },
-    {  1, 40, 34.80, +40, 34, 36.8, 4.94 },
-    { 20, 39, 33.31, +40, 34, 45.8, 6.06 },
-    {  3,  5, 20.81, +40, 34, 57.0, 6.05 },
-    { 19, 50, 37.30, +40, 35, 58.9, 5.69 },
-    { 12, 16,  7.61, +40, 39, 37.1, 5.66 },
-    { 10, 10, 58.90, +40, 39, 41.0, 6.32 },
-    {  7, 24,  8.50, +40, 40, 19.9, 5.19 },
-    { 18, 58, 46.61, +40, 40, 45.1, 6.22 },
-    { 19,  0, 19.01, +40, 41,  3.1, 6.65 },
-    {  1, 54, 53.81, +40, 42,  6.8, 6.24 },
-    { 20, 54, 22.30, +40, 42, 11.2, 6.70 },
-    { 19, 44, 49.01, +40, 43,   .1, 6.34 },
-    { 13, 28, 26.21, +40, 43, 46.9, 6.47 },
-    {  0, 19, 41.59, +40, 43, 46.9, 6.33 },
-    {  1, 53, 17.30, +40, 43, 46.9, 5.40 },
-    { 20, 18,  7.01, +40, 43, 55.9, 5.84 },
-    { 17,  9, 33.31, +40, 46, 37.9, 5.08 },
-    {  4, 44, 12.89, +40, 47, 12.8, 6.08 },
-    { 21, 41, 34.30, +40, 48, 19.1, 6.11 },
-    { 15, 30, 55.80, +40, 49, 59.2, 5.02 },
-    { 13, 15, 31.99, +40, 51, 19.1, 5.79 },
-    { 12, 38, 46.30, +40, 52, 27.8, 6.37 },
-    {  7, 18,  2.21, +40, 52, 59.9, 5.78 },
-    { 15, 31, 46.99, +40, 53, 57.8, 5.02 },
-    { 18, 39, 33.10, +40, 56,  6.0, 6.25 },
-    { 18, 17,  6.79, +40, 56, 12.1, 6.11 },
-    {  3,  8, 10.10, +40, 57, 20.2, 2.12 },
-    { 14, 27, 27.31, +41,  1, 30.0, 6.63 },
-    { 20, 22, 45.31, +41,  1, 34.0, 5.93 },
-    {  5, 22, 50.30, +41,  1, 45.8, 5.54 },
-    {  2, 59, 39.89, +41,  1, 59.2, 5.89 },
-    {  0, 13, 30.79, +41,  2,  7.1, 5.72 },
-    { 21, 18, 55.30, +41,  2, 26.9, 6.15 },
-    {  6,  8, 22.99, +41,  3, 20.2, 6.36 },
-    {  9, 57, 41.09, +41,  3, 20.2, 5.14 },
-    {  6, 49, 19.01, +41,  3, 33.0,      },
-    {  5,  2, 28.70, +41,  4, 32.9, 3.75 },
-    {  1, 35, 52.51, +41,  4, 35.0, 6.38 },
-    { 21, 42, 22.90, +41,  4, 37.9, 5.69 },
-    {  0, 49, 48.79, +41,  4, 44.0, 4.53 },
-    {  5, 20, 14.81, +41,  5, 10.0, 5.52 },
-    { 13, 46, 13.49, +41,  5, 19.0, 5.87 },
-    { 11, 13, 40.20, +41,  5, 19.0, 6.33 },
-    {  1, 27, 26.59, +41,  6,  2.2, 6.46 },
-    { 23, 24, 34.99, +41,  6, 46.1, 6.72 },
-    { 20, 22,  3.00, +41,  7, 53.0, 6.39 },
-    { 18, 12, 42.60, +41,  8, 48.8, 6.36 },
-    { 21, 49, 40.10, +41,  8, 56.0, 6.48 },
-    { 21, 43,  6.41, +41,  9, 18.0, 5.49 },
-    { 20, 57, 10.39, +41, 10,  1.9, 3.94 },
-    { 18, 54, 14.30, +41, 13, 32.2, 7.30 },
-    { 10, 22, 10.49, +41, 13, 45.8, 5.76 },
-    {  5,  6, 30.91, +41, 14,  3.8, 3.17 },
-    { 17, 33,  7.30, +41, 14, 37.0, 5.74 },
-    {  3, 25,  9.41, +41, 15, 25.9, 6.51 },
-    {  0, 42, 41.70, +41, 15, 50.0,      },
-    {  4, 36, 41.40, +41, 15, 52.9, 4.25 },
-    {  1,  2, 54.29, +41, 20, 42.0, 5.98 },
-    { 12, 33, 44.50, +41, 21, 27.0, 4.26 },
-    { 18, 52,  7.10, +41, 22, 59.9, 6.28 },
-    {  2, 22, 50.30, +41, 23, 47.0, 5.82 },
-    {  1, 36, 47.81, +41, 24, 20.2, 4.09 },
-    { 19,  6, 16.99, +41, 24, 50.0, 6.49 },
-    { 18, 46, 13.01, +41, 26, 30.1, 6.07 },
-    {  5,  3, 18.60, +41, 26, 30.1, 6.14 },
-    {  5, 30, 48.60, +41, 27, 42.8, 6.00 },
-    { 10, 22, 19.70, +41, 29, 57.8, 3.05 },
-    { 14, 14, 23.50, +41, 31,  8.0, 6.24 },
-    { 22, 41, 36.10, +41, 32, 57.8, 5.94 },
-    { 10, 27, 28.01, +41, 36,  2.9, 6.02 },
-    { 18, 54, 52.20, +41, 36, 10.1, 5.44 },
-    { 22, 56, 23.59, +41, 36, 14.0, 5.59 },
-    { 21,  3, 52.10, +41, 37, 41.2, 6.33 },
-    { 13, 42, 28.80, +41, 40, 27.1, 6.30 },
-    {  1, 57, 56.40, +41, 41, 39.8, 6.78 },
-    { 20, 41, 56.50, +41, 43,   .8, 5.67 },
-    { 20, 33, 48.41, +41, 46, 19.9, 6.49 },
-    { 19, 43, 45.00, +41, 46, 23.2, 5.84 },
-    { 23, 18, 23.40, +41, 46, 25.0, 6.02 },
-    {  6, 50, 45.91, +41, 46, 53.0, 5.02 },
-    {  9,  0, 38.40, +41, 46, 58.1, 3.97 },
-    { 14, 29, 36.79, +41, 47, 44.9, 6.35 },
-    {  5, 21, 48.41, +41, 48, 15.8, 5.23 },
-    {  4, 20, 14.40, +41, 48, 29.2, 5.92 },
-    { 22, 44,  5.50, +41, 49,  9.1, 5.08 },
-    {  6,  7, 26.90, +41, 51, 15.1, 6.12 },
-    { 16, 28, 38.50, +41, 52, 54.1, 5.04 },
-    { 16, 50, 36.10, +41, 53, 48.1, 6.29 },
-    { 20, 58, 30.79, +41, 56, 25.1, 6.16 },
-    { 18,  5,   .79, +41, 56, 48.1, 6.34 },
-    { 22, 50, 21.79, +41, 57, 13.0, 5.92 },
-    {  8, 52, 10.01, +42,  0,  9.0, 5.99 },
-    {  8, 24, 42.79, +42,  0, 18.0, 6.02 },
-    { 10, 56, 14.50, +42,  0, 29.9, 6.03 },
-    { 23, 19, 52.39, +42,  4, 41.2, 5.79 },
-    { 22, 21, 50.90, +42,  4, 41.9, 6.41 },
-    {  1, 10, 18.79, +42,  4, 53.0, 5.65 },
-    {  0,  4, 36.70, +42,  5, 31.9, 6.01 },
-    { 20, 14, 21.60, +42,  6, 13.0, 6.71 },
-    { 13, 31, 15.79, +42,  6, 22.0, 6.08 },
-    {  5, 33, 28.70, +42,  6, 32.0, 6.55 },
-    {  4, 18,  8.21, +42,  8, 28.0, 6.22 },
-    { 18, 15, 38.81, +42,  9, 33.8, 5.59 },
-    { 15, 14, 10.30, +42, 10, 17.0, 6.13 },
-    { 16, 47, 19.80, +42, 14, 20.0, 5.87 },
-    { 21, 16, 29.59, +42, 15,  5.0, 6.43 },
-    { 19, 57, 56.21, +42, 15, 38.9, 6.43 },
-    { 23,  1, 55.30, +42, 19, 34.0, 3.62 },
-    {  2,  3, 54.00, +42, 19, 46.9, 2.26 },
-    {  2,  3, 54.70, +42, 19, 50.9, 4.84 },
-    {  0,  1, 43.80, +42, 22,  1.9, 6.25 },
-    { 16, 11, 47.59, +42, 22, 27.8, 5.87 },
-    {  3, 12,  9.60, +42, 22, 34.0, 6.15 },
-    { 20, 53, 26.40, +42, 24, 37.1, 6.66 },
-    { 19, 34, 41.21, +42, 24, 46.1, 5.35 },
-    {  4, 23, 35.90, +42, 25, 41.2, 6.23 },
-    {  8,  9, 23.11, +42, 25, 50.2, 6.27 },
-    { 16, 34,  6.19, +42, 26, 12.8, 4.20 },
-    { 15, 52, 40.49, +42, 27,  6.1, 4.62 },
-    {  6, 39, 19.90, +42, 29, 20.0, 4.79 },
-    {  3, 14, 56.71, +42, 30, 14.0, 6.07 },
-    { 16, 57, 50.21, +42, 30, 45.0, 6.34 },
-    {  5, 47, 14.69, +42, 31, 36.1, 6.29 },
-    { 12, 23, 46.99, +42, 32, 34.1, 6.06 },
-    { 15, 55, 30.60, +42, 33, 58.0, 5.75 },
-    {  3, 45, 11.59, +42, 34, 43.0, 3.77 },
-    {  3, 38,   .19, +42, 34, 59.2, 6.42 },
-    {  4, 52, 47.81, +42, 35, 12.1, 5.71 },
-    {  1, 41, 47.21, +42, 36, 49.0, 4.95 },
-    {  7, 21,  3.10, +42, 39, 20.2, 6.35 },
-    { 23, 57,  3.60, +42, 39, 29.9, 5.97 },
-    { 21, 17, 23.21, +42, 40, 59.9, 6.19 },
-    { 20, 17, 29.09, +42, 43, 18.8, 6.29 },
-    { 23,  2, 36.29, +42, 45, 28.1, 5.10 },
-    {  5, 18, 15.91, +42, 47, 31.9, 5.48 },
-    { 19, 39, 26.50, +42, 49,  5.9, 5.40 },
-    { 21, 41, 43.80, +42, 50, 28.0,      },
-    { 11,  0, 20.59, +42, 54, 41.0, 6.02 },
-    {  6,  3, 18.00, +42, 54, 42.1, 6.10 },
-    { 23, 27,  7.39, +42, 54, 42.8, 5.75 },
-    { 10, 17,  5.81, +42, 54, 51.8, 3.45 },
-    { 22, 14, 44.40, +42, 57, 14.0, 5.71 },
-    {  6,  5,  3.41, +42, 58, 54.1, 5.87 },
-    { 20, 22, 55.51, +42, 58, 59.9, 6.20 },
-    {  7, 35, 55.99, +43,  1, 52.0, 6.30 },
-    { 12,  2,  6.79, +43,  2, 44.2, 5.21 },
-    { 21, 46, 16.61, +43,  3, 38.9, 6.54 },
-    {  4, 33, 24.91, +43,  3, 50.0, 6.09 },
-    { 19, 40, 41.21, +43,  4, 40.1, 6.16 },
-    { 22, 30, 29.30, +43,  7, 23.9, 4.51 },
-    { 15, 54, 37.90, +43,  8, 19.0, 5.37 },
-    { 11, 30, 31.10, +43, 10, 23.9, 5.94 },
-    {  5,  6, 49.61, +43, 10, 28.9, 6.20 },
-    {  8, 22, 50.09, +43, 11, 17.2, 4.25 },
-    { 10, 53, 58.70, +43, 11, 24.0, 4.71 },
-    { 20, 32, 52.30, +43, 11, 30.1, 6.60 },
-    { 11,  9, 38.50, +43, 12, 27.0, 5.89 },
-    { 16, 45, 11.71, +43, 13,  1.9, 6.05 },
-    {  9, 13, 48.19, +43, 13,  4.1, 5.32 },
-    { 18, 36, 45.60, +43, 13, 18.8, 6.20 },
-    {  8,  7,  9.91, +43, 15, 37.1, 6.26 },
-    { 23, 38,  8.21, +43, 16,  5.2, 4.29 },
-    { 21, 40, 11.11, +43, 16, 26.0, 5.11 },
-    {  1, 40, 39.79, +43, 17, 52.1, 5.61 },
-    { 22, 52,  1.99, +43, 18, 45.0, 4.94 },
-    {  3, 21, 26.50, +43, 19, 45.8, 4.95 },
-    {  4, 42, 54.29, +43, 21, 54.0, 5.29 },
-    {  6,  2, 53.59, +43, 22, 43.0, 6.42 },
-    { 20, 13, 42.79, +43, 22, 45.1, 6.14 },
-    { 19, 23, 56.50, +43, 23, 17.2, 5.84 },
-    { 16, 49, 40.49, +43, 25, 50.2, 6.13 },
-    {  1, 26, 18.60, +43, 27, 28.1, 5.96 },
-    { 20, 40,  3.10, +43, 27, 31.0, 5.95 },
-    { 18,  7, 28.80, +43, 27, 42.1, 5.00 },
-    { 17, 40, 37.61, +43, 28, 14.9, 6.59 },
-    { 11, 22, 49.61, +43, 28, 58.1, 4.99 },
-    {  0, 32, 26.81, +43, 29, 40.9, 6.70 },
-    { 23, 10, 27.19, +43, 32, 39.1, 5.94 },
-    {  6, 46, 44.30, +43, 34, 39.0, 5.25 },
-    {  0, 16, 21.60, +43, 35, 40.9, 6.15 },
-    { 11, 38, 20.59, +43, 37, 32.2, 5.59 },
-    { 14, 38, 12.50, +43, 38, 30.8, 5.70 },
-    {  8, 51, 56.81, +43, 43, 36.1, 5.15 },
-    {  0, 18, 42.10, +43, 47, 28.0, 6.11 },
-    { 17,  5,  4.99, +43, 48, 43.9, 6.43 },
-    {  5,  1, 58.10, +43, 49, 23.9, 2.99 },
-    { 14,  7, 55.80, +43, 51, 15.8, 5.27 },
-    { 13, 22,  3.79, +43, 54, 11.2, 6.35 },
-    {  3, 31, 11.80, +43, 54, 17.0,      },
-    {  6, 55, 14.69, +43, 54, 36.0, 6.13 },
-    { 21,  4, 55.90, +43, 55, 40.1, 3.72 },
-    {  1,  8,   .89, +43, 56, 30.8, 5.03 },
-    { 21, 18, 27.19, +43, 56, 44.9, 5.00 },
-    { 18, 55, 20.09, +43, 56, 46.0, 4.04 },
-    {  3, 49,  8.21, +43, 57, 47.2, 6.02 },
-    {  7, 58, 16.61, +43, 58, 39.0, 6.34 },
-    {  6, 39, 58.01, +44,  0, 50.0, 6.41 },
-    {  3, 17, 47.40, +44,  1, 30.0, 5.47 },
-    { 23,  2, 45.19, +44,  3, 32.0, 6.39 },
-    { 20, 50,  4.90, +44,  3, 33.8, 5.04 },
-    {  4, 54, 51.31, +44,  3, 38.9, 6.08 },
-    { 17, 43,  5.59, +44,  5,  3.8, 6.34 },
-    { 12, 44, 27.10, +44,  6, 11.2, 6.33 },
-    { 23, 20, 43.99, +44,  6, 59.0, 6.13 },
-    { 13, 35, 14.09, +44, 11, 48.8, 6.84 },
-    {  2, 13, 13.30, +44, 13, 54.1, 4.83 },
-    { 22, 40, 30.91, +44, 16, 35.0, 4.46 },
-    {  2, 44,  5.21, +44, 17, 48.8, 5.43 },
-    {  2, 17, 33.41, +44, 18, 24.8, 6.70 },
-    { 23, 40, 24.50, +44, 20,  2.0, 4.14 },
-    {  1, 39, 21.00, +44, 23, 10.0, 4.98 },
-    { 20, 53, 14.81, +44, 23, 13.9, 4.78 },
-    {  0, 28, 13.70, +44, 23, 39.8, 5.17 },
-    { 14, 38, 50.21, +44, 24, 15.8, 5.39 },
-    {  5, 20,  2.30, +44, 25, 32.2, 6.62 },
-    { 23, 37, 31.99, +44, 25, 45.1, 5.80 },
-    { 15, 20, 41.59, +44, 26,  3.1, 6.19 },
-    {  2,  8, 33.60, +44, 27, 33.8, 6.42 },
-    { 20, 58, 19.49, +44, 28, 18.1, 5.55 },
-    {  0, 36, 46.61, +44, 29, 19.0, 5.13 },
-    { 11,  9, 39.79, +44, 29, 55.0, 3.01 },
-    {  6, 43,  4.99, +44, 31, 27.8, 5.02 },
-    { 22, 46, 10.20, +44, 32, 46.0, 5.76 },
-    { 23,  8, 12.29, +44, 33, 42.1, 6.56 },
-    {  6,  0, 19.01, +44, 35, 30.8, 6.22 },
-    { 15,  3,  6.60, +44, 38, 39.8, 6.65 },
-    { 22,  2, 56.69, +44, 39,   .0, 5.60 },
-    { 19, 36, 37.90, +44, 41, 42.0, 5.17 },
-    { 21, 37, 27.89, +44, 41, 48.1, 6.20 },
-    {  1,  0,  3.41, +44, 42, 40.0, 6.84 },
-    {  1,  0,  3.60, +44, 42, 47.9, 6.04 },
-    { 22, 53, 40.10, +44, 44, 57.1, 5.81 },
-    { 21,  2, 24.10, +44, 47, 28.0, 6.19 },
-    {  6, 53,  7.61, +44, 50, 21.8, 6.26 },
-    {  3, 32, 39.10, +44, 51, 20.2, 6.41 },
-    {  3,  9, 29.81, +44, 51, 25.9, 3.80 },
-    {  0, 46, 10.90, +44, 51, 41.0, 6.05 },
-    {  1, 17,  5.09, +44, 54,  6.8, 6.34 },
-    { 20, 56, 34.70, +44, 55, 30.0, 5.96 },
-    { 16,  8, 46.20, +44, 56,  6.0, 4.26 },
-    {  5, 59, 31.70, +44, 56, 51.0, 1.90 },
-    {  3, 50,  4.49, +44, 58,  4.1, 5.66 },
-    { 23, 42, 14.81, +44, 59, 30.8, 6.57 },
-    {  0, 50, 18.31, +45,  0,  7.9, 6.15 },
-    { 22,  6,  1.99, +45,  0, 51.8, 5.14 },
-    { 23, 33, 42.70, +45,  3, 29.2, 6.24 },
-    {  6, 57, 37.10, +45,  5, 39.1, 4.90 },
-    { 11, 38, 44.90, +45,  6, 31.0, 6.44 },
-    { 22,  5, 50.59, +45,  6, 43.9, 6.44 },
-    { 19, 44, 58.49, +45,  7, 50.9, 2.87 },
-    { 23, 19,  2.40, +45,  8, 13.9, 6.50 },
-    { 23, 17, 16.61, +45,  9, 51.1, 6.43 },
-    { 20, 53, 18.60, +45, 10, 54.8, 5.45 },
-    { 22, 38, 17.50, +45, 10, 59.2, 6.40 },
-    { 18, 15, 32.59, +45, 12, 33.8, 6.29 },
-    { 10, 28, 36.50, +45, 12, 43.9, 6.35 },
-    {  7, 21, 17.50, +45, 13, 41.2, 5.77 },
-    {  0,  5,  9.89, +45, 13, 45.1, 6.70 },
-    { 22,  6, 12.41, +45, 14, 55.0, 6.19 },
-    {  0,  0, 43.70, +45, 15, 11.9, 6.38 },
-    { 13,  5, 52.30, +45, 16,  7.0, 5.63 },
-    { 15, 24,  5.11, +45, 16, 16.0, 6.01 },
-    { 20, 41, 25.90, +45, 16, 49.1, 1.25 },
-    {  8, 52, 11.59, +45, 18, 45.0, 5.99 },
-    {  1, 43, 16.51, +45, 19, 19.9, 6.34 },
-    {  1, 12, 34.01, +45, 20, 16.1, 6.11 },
-    {  3, 16,  4.70, +45, 20, 44.9, 6.16 },
-    { 17, 56, 48.41, +45, 21,  2.9, 6.02 },
-    { 21, 36,  2.40, +45, 22, 28.9, 5.53 },
-    { 23,  0, 34.39, +45, 22, 30.0, 6.50 },
-    {  1, 38, 31.70, +45, 24,   .0, 6.36 },
-    {  1, 27, 39.41, +45, 24, 24.1, 4.83 },
-    {  9, 57, 56.90, +45, 24, 51.8, 6.30 },
-    { 12, 45,  7.80, +45, 26, 25.1, 4.99 },
-    { 22, 13, 49.30, +45, 26, 26.9, 5.53 },
-    { 17, 58, 52.30, +45, 28, 34.0, 6.48 },
-    { 23, 17, 56.11, +45, 29, 20.0, 6.48 },
-    { 17, 59, 56.21, +45, 30,  5.0, 5.67 },
-    { 21,  9, 58.61, +45, 30,  9.0, 6.63 },
-    { 19, 40, 50.21, +45, 31, 30.0, 5.06 },
-    { 11,  0, 14.69, +45, 31, 34.0, 5.47 },
-    {  1, 22, 20.40, +45, 31, 44.0, 4.88 },
-    { 20, 16,   .60, +45, 34, 45.8, 5.91 },
-    { 20, 47, 20.81, +45, 34, 46.9, 6.40 },
-    { 21, 33, 58.90, +45, 35, 30.8, 4.02 },
-    { 16, 31, 47.30, +45, 35, 53.9, 5.65 },
-    {  9, 28, 40.01, +45, 36,  5.0, 5.41 },
-    {  8, 56, 49.99, +45, 37, 54.8, 5.74 },
-    {  8, 27, 36.79, +45, 39, 11.2, 6.32 },
-    { 20, 39, 23.11, +45, 40,   .8, 6.58 },
-    {  3, 45, 59.30, +45, 40, 54.8, 5.66 },
-    { 22,  8, 40.99, +45, 44, 30.8, 6.11 },
-    { 14,  2, 12.19, +45, 45, 13.0, 6.27 },
-    { 21, 42,  8.40, +45, 45, 56.9, 6.17 },
-    { 19, 59, 20.50, +45, 46, 19.9, 5.92 },
-    { 20, 22,  5.40, +45, 47, 42.0, 5.58 },
-    {  6, 55, 15.19, +45, 49, 35.0, 6.34 },
-    {  8, 41,  1.10, +45, 50,  2.0, 5.37 },
-    {  0, 57, 39.70, +45, 50, 22.9, 6.12 },
-    { 21,  2, 48.50, +45, 50, 56.0, 6.48 },
-    { 21, 33, 17.90, +45, 51, 15.1, 6.25 },
-    { 20, 29, 59.90, +45, 55, 43.0, 6.41 },
-    {  5, 59, 56.09, +45, 56, 12.8, 4.26 },
-    { 19, 39, 34.39, +45, 57, 29.2, 6.20 },
-    { 16, 49, 14.21, +45, 58, 59.9, 4.82 },
-    {  5, 16, 41.40, +45, 59, 53.2, 0.08 },
-    { 17, 39, 27.89, +46,  0, 23.0, 3.80 },
-    {  9, 48, 35.40, +46,  1, 16.0, 5.09 },
-    { 13, 26, 16.61, +46,  1, 41.2, 5.88 },
-    { 16,  2, 47.90, +46,  2, 12.1, 4.76 },
-    {  3, 32, 26.30, +46,  3, 24.8, 5.31 },
-    { 23,  7, 18.10, +46,  4,  5.2, 6.66 },
-    {  0, 10, 19.30, +46,  4, 19.9, 5.03 },
-    { 14, 16, 22.99, +46,  5, 17.9, 4.18 },
-    {  3, 44, 40.90, +46,  5, 58.9, 6.11 },
-    { 20, 48, 56.30, +46,  6, 51.1, 4.84 },
-    { 14, 49, 18.70, +46,  6, 58.0, 5.74 },
-    {  1, 44, 26.50, +46,  8, 22.9, 6.35 },
-    { 21,  1, 10.90, +46,  9, 20.9, 5.37 },
-    { 12, 57,  7.70, +46, 10, 36.8, 6.12 },
-    {  7, 36, 31.61, +46, 10, 49.1, 5.65 },
-    { 23, 37, 58.61, +46, 11, 58.9, 6.58 },
-    { 10, 43, 32.90, +46, 12, 14.0, 5.18 },
-    {  1, 47, 48.00, +46, 13, 46.9, 6.32 },
-    { 17, 20, 21.10, +46, 14, 26.9, 5.59 },
-    {  6, 56, 32.30, +46, 16, 27.1, 5.87 },
-    { 16, 19, 44.40, +46, 18, 47.9, 3.89 },
-    { 18, 46, 58.99, +46, 18, 54.0, 6.52 },
-    { 20, 18, 49.61, +46, 19, 22.1, 6.45 },
-    {  6, 18, 16.90, +46, 21, 38.2, 6.38 },
-    { 23,  7, 39.31, +46, 23, 13.9, 5.33 },
-    { 23, 58, 46.51, +46, 24, 47.2, 6.54 },
-    { 23, 46,  2.11, +46, 25, 13.1, 4.95 },
-    {  6, 17, 34.70, +46, 25, 27.1, 6.52 },
-    { 23, 37, 33.89, +46, 27, 29.2, 3.82 },
-    { 11, 55, 11.21, +46, 28, 10.9, 7.03 },
-    {  2, 19, 10.90, +46, 28, 21.0, 6.21 },
-    { 11, 55,  5.69, +46, 28, 36.8, 6.54 },
-    {  4, 21, 33.19, +46, 29, 56.0, 4.85 },
-    { 20, 46, 38.50, +46, 31, 54.1, 6.30 },
-    { 22, 21,  1.61, +46, 32, 12.1, 4.57 },
-    { 21, 29, 27.00, +46, 32, 26.2, 5.24 },
-    { 16, 36, 11.21, +46, 36, 47.9, 5.79 },
-    { 17, 52,  1.01, +46, 38, 35.9, 6.38 },
-    { 11, 30, 25.01, +46, 39, 27.0, 6.35 },
-    { 20, 49, 54.70, +46, 39, 40.0, 6.33 },
-    {  6, 30,  3.00, +46, 41,  8.2, 5.90 },
-    { 20, 33, 54.91, +46, 41, 38.0, 5.78 },
-    {  6, 56, 55.99, +46, 42, 18.0, 5.86 },
-    { 21, 25, 19.61, +46, 42, 51.8, 5.60 },
-    { 20, 13, 37.90, +46, 44, 29.0, 3.79 },
-    { 22,  5, 16.39, +46, 44, 40.9, 6.13 },
-    { 10, 18, 58.99, +46, 45, 38.9, 6.43 },
-    { 15, 38, 16.20, +46, 47, 52.1, 5.75 },
-    { 20, 13, 18.00, +46, 48, 56.9, 4.83 },
-    {  9, 17, 31.20, +46, 49,  1.9, 5.97 },
-    { 23, 47, 33.19, +46, 49, 57.0, 6.07 },
-    { 11, 38, 33.50, +46, 50,  3.1, 6.10 },
-    { 20, 19, 56.11, +46, 50, 15.0, 6.50 },
-    {  2, 51, 41.71, +46, 50, 30.8, 5.88 },
-    { 21,  3, 43.30, +46, 51, 42.8, 6.32 },
-    {  8, 43,   .19, +46, 54,  4.0, 6.22 },
-    {  9, 34, 19.61, +46, 54,  7.9, 6.52 },
-    { 19,  1, 26.40, +46, 56,  4.9, 5.01 },
-    {  3, 29, 26.21, +46, 56, 16.1, 6.24 },
-    {  5, 10, 42.89, +46, 57, 43.9, 5.68 },
-    {  5, 20, 39.29, +46, 57, 50.0, 6.54 },
-    { 19, 16, 51.41, +46, 59, 57.1, 6.00 },
-    {  1, 30,  6.19, +47,  0, 25.9, 5.27 },
-    {  0, 43, 28.10, +47,  1, 28.9, 4.94 },
-    { 19, 51, 59.09, +47,  1, 39.0, 5.62 },
-    {  9,  3, 37.49, +47,  9, 24.1, 3.60 },
-    {  2, 56, 33.41, +47,  9, 50.0, 6.02 },
-    { 22, 43,  4.49, +47, 10,  7.0, 6.39 },
-    { 12, 54, 56.50, +47, 11, 48.1, 5.84 },
-    { 15, 28, 44.50, +47, 12,  5.0, 6.15 },
-    {  2, 59, 49.90, +47, 13, 14.9, 5.47 },
-    {  7, 15, 50.09, +47, 14, 24.0, 5.58 },
-    {  1,  9, 30.19, +47, 14, 30.8, 4.25 },
-    { 15,  0, 38.71, +47, 16, 40.1, 6.37 },
-    {  3,  7, 47.40, +47, 18, 29.9, 6.41 },
-    {  2, 20, 41.40, +47, 18, 38.9, 6.11 },
-    { 23, 55, 33.60, +47, 21, 20.9, 6.00 },
-    {  1,  3,  1.51, +47, 22, 34.0, 6.45 },
-    { 19, 51, 19.39, +47, 22, 37.9, 6.20 },
-    {  2, 19, 16.80, +47, 22, 48.0, 5.30 },
-    {  7, 54, 29.30, +47, 23, 10.0, 6.25 },
-    {  6, 27, 51.10, +47, 24, 19.1, 6.56 },
-    { 16, 53, 17.59, +47, 25,   .8, 6.00 },
-    { 20, 55, 49.80, +47, 25,  4.1, 5.67 },
-    {  1, 18, 10.20, +47, 25, 10.9, 6.25 },
-    {  2, 14,  2.59, +47, 29,  3.1, 6.06 },
-    { 20, 59, 49.61, +47, 31, 16.0, 4.74 },
-    {  7, 54, 42.70, +47, 33, 52.9, 5.45 },
-    { 17, 47,  8.11, +47, 36, 43.9, 6.43 },
-    { 21,  6, 36.10, +47, 38, 53.9, 4.55 },
-    { 15,  3, 47.40, +47, 39, 15.8, 4.76 },
-    { 21, 10, 31.01, +47, 41, 30.8, 6.46 },
-    { 22, 29, 31.80, +47, 42, 24.8, 4.36 },
-    {  4,  8, 39.70, +47, 42, 45.0, 4.04 },
-    { 20, 15, 28.30, +47, 42, 51.8, 3.98 },
-    {  5, 36, 15.91, +47, 42, 55.1, 6.11 },
-    {  3, 12, 26.40, +47, 43, 32.9, 6.33 },
-    { 20, 12,  3.79, +47, 44, 12.8, 6.92 },
-    {  7,  5,  9.00, +47, 46, 30.0, 6.38 },
-    { 11, 46,  3.00, +47, 46, 45.8, 3.71 },
-    {  3, 42, 55.51, +47, 47, 15.0, 3.01 },
-    { 19, 53,  1.20, +47, 48, 27.0, 6.29 },
-    {  2, 15, 57.89, +47, 48, 41.0, 6.33 },
-    { 20, 47, 49.30, +47, 49, 54.8, 5.57 },
-    {  0, 44, 26.40, +47, 51, 51.1, 5.67 },
-    {  3, 55, 58.20, +47, 52, 17.0, 5.37 },
-    {  1, 49, 15.70, +47, 53, 48.8, 5.82 },
-    {  6,  0, 58.61, +47, 54,  6.8, 5.73 },
-    { 19, 47, 26.81, +47, 54, 28.1, 6.12 },
-    { 11, 30, 52.90, +47, 55, 45.1, 6.42 },
-    { 19, 52,  7.20, +47, 55, 54.8, 5.91 },
-    {  0, 17,  9.10, +47, 56, 51.0, 5.89 },
-    { 21, 15, 36.79, +47, 58, 25.0, 6.46 },
-    {  3, 30, 34.49, +47, 59, 43.1, 4.36 },
-    { 14, 17, 49.20, +48,  0,  6.1, 6.32 },
-    {  3, 32,  8.59, +48,  1, 25.0, 5.47 },
-    {  8, 59, 12.41, +48,  2, 30.1, 3.14 },
-    {  1, 16, 24.50, +48,  4, 55.9, 6.61 },
-    {  3, 30, 37.01, +48,  6, 13.0, 5.82 },
-    {  7, 41, 12.41, +48,  7, 54.1, 5.56 },
-    { 15,  5, 25.80, +48,  9,  4.0, 5.57 },
-    {  0, 11, 59.09, +48,  9,  9.0, 6.16 },
-    { 19, 34, 39.91, +48,  9, 52.9, 6.67 },
-    {  3, 13, 24.00, +48, 10, 36.8, 5.90 },
-    {  7, 28, 51.60, +48, 11,  2.0, 5.72 },
-    { 17, 20, 33.60, +48, 11, 17.9, 6.43 },
-    {  3, 36, 29.40, +48, 11, 34.1, 4.23 },
-    { 20,  4, 28.80, +48, 13, 46.9, 6.16 },
-    { 22,  5, 51.19, +48, 13, 54.1, 6.27 },
-    { 17, 26, 44.21, +48, 15, 36.0, 5.85 },
-    {  2, 43,  1.90, +48, 15, 56.2, 6.48 },
-    {  0, 44, 43.49, +48, 17,  3.8, 4.54 },
-    {  4, 41, 24.10, +48, 18,  2.9, 5.67 },
-    { 23, 19, 41.59, +48, 22, 50.9, 6.32 },
-    { 17, 50,  3.31, +48, 23, 39.1, 6.68 },
-    { 10, 19, 26.81, +48, 23, 48.8, 6.00 },
-    {  4, 14, 53.90, +48, 24, 33.8, 4.14 },
-    {  9, 42, 43.10, +48, 25, 52.0, 6.39 },
-    { 18,  3,  9.00, +48, 27, 51.8, 6.21 },
-    { 12, 48, 41.81, +48, 28,   .8, 6.27 },
-    {  3, 44,  6.41, +48, 31, 25.0, 6.06 },
-    {  9,  5, 24.10, +48, 31, 49.1, 5.95 },
-    {  2, 53, 21.19, +48, 34,  9.8, 6.26 },
-    { 17, 36, 37.61, +48, 35,  8.2, 5.37 },
-    { 23, 19, 29.81, +48, 37, 31.1, 5.44 },
-    {  1, 37, 59.59, +48, 37, 41.9, 3.57 },
-    {  3, 53, 38.71, +48, 39,  2.2, 5.76 },
-    { 21, 57,  2.21, +48, 40,  7.0, 6.42 },
-    {  0, 55,  5.21, +48, 40, 43.0, 6.27 },
-    { 22, 57,  4.49, +48, 41,  3.1, 5.43 },
-    {  6, 11, 36.60, +48, 42, 40.0, 6.09 },
-    {  6, 11, 36.50, +48, 42, 47.2, 6.82 },
-    { 14, 49, 41.30, +48, 43, 14.2, 5.69 },
-    {  1, 36, 27.19, +48, 43, 22.1, 5.92 },
-    {  4, 51,  9.29, +48, 44, 26.9, 5.66 },
-    { 18, 48, 16.10, +48, 46,  3.0, 6.12 },
-    {  7, 37, 53.90, +48, 46, 25.0, 5.92 },
-    { 10, 28,  3.79, +48, 47,  4.9, 6.44 },
-    { 11, 31, 10.20, +48, 47, 21.1, 6.56 },
-    {  6, 47, 39.60, +48, 47, 21.8, 5.22 },
-    { 17,  4, 49.80, +48, 48, 15.1, 6.09 },
-    { 21, 26, 51.60, +48, 50,  6.0, 5.31 },
-    { 18, 54, 47.11, +48, 51, 34.9, 5.77 },
-    {  0, 20,  5.21, +48, 51, 55.1, 6.52 },
-    { 16, 38, 44.90, +48, 55, 41.9, 4.90 },
-    { 20, 30,  3.50, +48, 57,  6.1, 4.95 },
-    {  2, 19, 22.70, +48, 57, 19.1, 6.37 },
-    {  6,  1, 43.10, +48, 57, 33.8, 5.96 },
-    { 16, 30,  6.00, +48, 57, 38.9, 6.45 },
-    { 12, 19, 48.70, +48, 59,  3.1, 5.29 },
-    { 23, 17, 44.69, +49,  0, 55.1, 4.85 },
-    { 13, 34, 27.31, +49,  0, 58.0, 4.70 },
-    {  5, 57,  4.90, +49,  1, 45.8, 6.47 },
-    { 16, 19, 11.21, +49,  2, 17.2, 5.91 },
-    {  3, 28,  3.10, +49,  3, 46.1, 4.98 },
-    {  3, 21, 52.61, +49,  4, 14.9, 5.93 },
-    { 18, 47, 40.01, +49,  4, 30.0, 6.40 },
-    {  3, 25, 57.41, +49,  7, 14.9, 6.09 },
-    { 18, 21, 32.71, +49,  7, 18.1, 5.05 },
-    { 23, 30,  7.39, +49,  7, 59.2, 6.17 },
-    { 20, 56, 25.90, +49, 11, 44.9, 5.90 },
-    {  1, 58, 33.60, +49, 12, 15.1, 5.69 },
-    {  3, 31, 29.40, +49, 12, 34.9, 6.29 },
-    {  7, 26, 42.79, +49, 12, 41.0, 4.64 },
-    {  3, 23, 13.20, +49, 12, 47.9, 5.29 },
-    { 20, 31, 18.79, +49, 13, 13.1, 5.44 },
-    {  2, 44, 12.00, +49, 13, 41.9, 4.12 },
-    { 19, 33, 41.59, +49, 15, 45.0, 5.96 },
-    { 19, 37, 56.69, +49, 17,  3.8, 6.47 },
-    {  6, 24, 53.90, +49, 17, 17.2, 4.91 },
-    { 23,  7, 45.41, +49, 17, 44.9, 5.70 },
-    { 21, 46, 47.59, +49, 18, 33.8, 4.23 },
-    { 13, 47, 32.40, +49, 18, 47.9, 1.86 },
-    { 21, 24, 55.51, +49, 19, 23.9, 6.58 },
-    {  0, 39,  9.91, +49, 21, 15.8, 5.43 },
-    { 22, 30,  6.50, +49, 21, 22.0, 6.40 },
-    { 14, 34, 39.60, +49, 22,  5.9, 5.74 },
-    { 20, 27,  2.30, +49, 22, 59.9, 5.69 },
-    { 21, 22,   .41, +49, 23, 20.0, 5.69 },
-    {  3, 31, 49.10, +49, 24,  2.9, 6.39 },
-    { 23, 12, 33.00, +49, 24, 23.0, 4.52 },
-    {  9, 33,  7.20, +49, 26, 19.0, 6.76 },
-    { 14,  8, 17.30, +49, 27, 29.2, 5.25 },
-    {  7, 18, 31.90, +49, 27, 54.0, 5.05 },
-    { 11, 16, 41.90, +49, 28, 35.0, 5.88 },
-    { 22, 24, 31.01, +49, 28, 35.0, 4.57 },
-    { 13, 36, 39.79, +49, 29, 12.1, 6.49 },
-    {  3, 29, 22.10, +49, 30, 32.0, 4.67 },
-    { 21, 19, 28.80, +49, 30, 37.1, 5.76 },
-    { 23, 41, 26.90, +49, 30, 43.9, 6.26 },
-    { 19, 18, 37.70, +49, 34, 10.9, 6.31 },
-    { 21, 42, 38.90, +49, 36,  1.1, 6.09 },
-    {  3,  9,  4.01, +49, 36, 47.9, 4.05 },
-    { 14, 56, 22.99, +49, 37, 43.0, 5.63 },
-    {  7, 29, 55.99, +49, 40, 21.0, 5.36 },
-    { 13, 18, 14.50, +49, 40, 54.8, 5.15 },
-    { 17, 16, 48.60, +49, 41, 28.0, 7.48 },
-    { 18,  7,  6.29, +49, 42, 38.2, 6.32 },
-    { 18, 21,  7.10, +49, 43, 32.2, 6.40 },
-    { 22, 56, 25.99, +49, 44,  1.0, 4.95 },
-    { 17, 11, 40.20, +49, 44, 48.1, 6.04 },
-    { 22,  8, 16.51, +49, 47, 47.0, 6.42 },
-    {  9, 55, 43.01, +49, 49, 12.0, 5.27 },
-    {  5, 45, 54.00, +49, 49, 35.0, 5.47 },
-    { 14, 28, 37.80, +49, 50, 40.9, 5.59 },
-    {  3, 28, 52.39, +49, 50, 53.9, 5.58 },
-    { 19, 12,  4.61, +49, 51, 15.1, 6.75 },
-    { 19, 12,  4.99, +49, 51, 22.0, 6.57 },
-    {  3, 24, 19.39, +49, 51, 40.0, 1.79 },
-    { 15, 59,  4.39, +49, 52, 52.0, 6.05 },
-    {  6,  2, 48.70, +49, 54, 20.2, 6.05 },
-    { 19,  5,  9.91, +49, 55, 23.9, 6.43 },
-    {  5, 59, 21.79, +49, 55, 27.8, 5.89 },
-    {  4, 43, 21.60, +49, 58, 26.0, 5.87 },
-    { 21, 32, 56.59, +49, 58, 40.1, 5.75 },
-    {  0,  1, 19.30, +49, 58, 54.1, 6.22 },
-    {  2, 24, 24.89, +50,  0, 24.1, 5.19 },
-    { 16, 56,  6.41, +50,  2, 20.0, 6.56 },
-    {  4, 19, 13.30, +50,  2, 56.0, 5.45 },
-    { 23,  4, 10.99, +50,  3,  7.9, 4.65 },
-    { 15,  8, 19.51, +50,  3, 18.0, 6.39 },
-    { 19, 15, 19.30, +50,  4, 14.9, 6.27 },
-    { 22, 35, 53.40, +50,  4, 16.0, 6.29 },
-    {  3, 19,  7.61, +50,  5, 42.0, 5.03 },
-    { 20,  1, 21.60, +50,  6, 16.9, 5.05 },
-    {  2, 20, 58.20, +50,  9,  5.0, 5.59 },
-    { 19, 36, 26.50, +50, 13, 16.0, 4.48 },
-    {  3, 18, 37.80, +50, 13, 19.9, 5.15 },
-    { 20,  7, 11.50, +50, 13, 45.1, 6.54 },
-    { 20, 15, 43.39, +50, 13, 58.1, 6.31 },
-    { 19, 35, 55.90, +50, 14, 19.0, 6.52 },
-    { 19, 23, 23.81, +50, 16, 17.0, 6.51 },
-    {  2, 25, 37.39, +50, 16, 43.0, 4.71 },
-    { 22, 31, 17.50, +50, 16, 57.0, 3.77 },
-    {  4, 18, 14.59, +50, 17, 44.2, 4.61 },
-    { 19, 31, 19.30, +50, 18, 24.1, 5.53 },
-    { 20, 42, 12.60, +50, 20, 24.0, 5.39 },
-    {  4,  6, 34.99, +50, 21,  5.0, 4.29 },
-    { 21,  3, 25.99, +50, 21,  6.8, 6.37 },
-    { 22, 52, 52.30, +50, 24, 42.8, 6.46 },
-    { 15, 38, 34.30, +50, 25, 23.9, 5.84 },
-    {  7, 44,  4.20, +50, 26,  2.0, 5.27 },
-    { 20, 58, 30.10, +50, 27, 43.9, 5.61 },
-    { 23, 39,  8.30, +50, 28, 18.1, 5.30 },
-    {  0, 42,  3.89, +50, 30, 45.0, 4.80 },
-    { 19, 41, 52.01, +50, 31,  3.0, 6.20 },
-    { 13, 40, 23.21, +50, 31,  9.8, 6.32 },
-    { 19, 41, 48.89, +50, 31, 31.1, 5.96 },
-    { 19,  0, 13.70, +50, 32,  1.0, 5.38 },
-    {  2, 27, 51.79, +50, 34, 10.9, 6.12 },
-    { 13, 28, 11.71, +50, 35, 13.9, 6.80 },
-    { 23, 14, 14.30, +50, 37,  4.1, 6.31 },
-    { 11, 37, 52.99, +50, 37,  5.9, 6.14 },
-    { 22, 50, 10.20, +50, 40, 36.8, 6.21 },
-    {  1, 43, 39.60, +50, 41, 19.0, 4.07 },
-    {  3, 56, 36.50, +50, 41, 43.1, 5.28 },
-    { 18, 53, 13.61, +50, 42, 29.9, 4.92 },
-    { 13, 37, 43.01, +50, 42, 52.9, 6.48 },
-    { 13, 28, 45.70, +50, 43,  5.9, 6.43 },
-    { 20, 56, 25.51, +50, 43, 43.0, 5.81 },
-    {  3, 48, 18.29, +50, 44, 12.1, 6.14 },
-    { 17, 49,  4.30, +50, 46, 52.0, 5.02 },
-    {  1, 52,  9.41, +50, 47, 34.1, 5.79 },
-    { 18, 58, 59.59, +50, 48, 33.8, 6.30 },
-    { 18,  6, 53.50, +50, 49, 22.1, 6.29 },
-    { 22, 11,  9.91, +50, 49, 23.9, 5.40 },
-    { 17,  8, 17.11, +50, 50, 31.9, 6.46 },
-    { 19, 56, 45.10, +50, 54,  9.0, 6.43 },
-    {  4, 20, 11.50, +50, 55, 14.9, 5.55 },
-    {  3, 16, 12.19, +50, 56, 16.1, 5.03 },
-    {  0, 48, 50.09, +50, 58,  5.9, 4.89 },
-    { 14,  2, 59.69, +50, 58, 18.8, 6.15 },
-    { 22, 20, 39.60, +50, 58, 50.9, 6.42 },
-    {  1,  4, 46.80, +51,  0, 36.0, 6.54 },
-    {  1,  2, 18.41, +51,  2,  6.0, 6.47 },
-    {  2, 13, 36.29, +51,  3, 56.9, 5.31 },
-    { 20, 56, 12.89, +51,  4, 30.0, 6.63 },
-    {  6, 13, 45.31, +51, 10, 21.0, 6.04 },
-    { 21, 42,  5.69, +51, 11, 22.9, 4.67 },
-    { 19, 34, 19.80, +51, 14, 12.1, 5.73 },
-    {  2, 56, 50.59, +51, 15, 38.9, 6.22 },
-    {  9, 20, 43.80, +51, 15, 58.0, 6.13 },
-    { 14, 17, 21.10, +51, 18, 25.9, 6.20 },
-    { 18, 19, 56.11, +51, 20, 52.1, 6.30 },
-    { 14, 16,  9.89, +51, 22,  1.9, 4.75 },
-    { 14, 49, 32.30, +51, 22, 28.9, 6.51 },
-    { 23, 58, 24.79, +51, 23, 19.0, 4.80 },
-    { 16, 28, 43.39, +51, 24, 28.1, 6.29 },
-    {  7, 13, 23.40, +51, 25, 44.0, 5.47 },
-    {  0, 17, 43.01, +51, 25, 59.2, 6.14 },
-    { 20, 12, 31.80, +51, 27, 49.0, 6.01 },
-    {  1, 52, 50.81, +51, 28, 28.9, 6.26 },
-    { 17, 56, 36.41, +51, 29, 20.0, 2.23 },
-    { 11,  0, 25.61, +51, 30,  6.8, 6.43 },
-    {  8,  8, 27.41, +51, 30, 24.1, 4.84 },
-    {  0, 50, 57.41, +51, 30, 29.2, 6.39 },
-    {  5, 50, 56.40, +51, 30, 52.9, 6.29 },
-    { 12, 30,  2.90, +51, 32,  8.2, 6.21 },
-    { 22, 37, 22.39, +51, 32, 43.1, 4.63 },
-    { 12, 24,  1.51, +51, 33, 43.9, 4.80 },
-    {  0, 51, 33.70, +51, 34, 16.0, 6.21 },
-    {  6,  4, 29.09, +51, 34, 23.9, 6.45 },
-    {  9, 24, 55.70, +51, 34, 26.0, 6.31 },
-    {  5,  6, 40.61, +51, 35, 52.1, 5.00 },
-    {  9,  8, 52.30, +51, 36, 16.9, 4.48 },
-    { 23, 50, 22.30, +51, 37, 18.1, 6.44 },
-    {  9, 32, 51.41, +51, 40, 37.9, 3.17 },
-    { 21, 34, 27.50, +51, 41, 53.9, 6.15 },
-    { 19, 29, 42.29, +51, 43, 46.9, 3.79 },
-    { 14, 13, 27.70, +51, 47, 16.1, 6.69 },
-    { 14, 13, 28.99, +51, 47, 25.1, 4.54 },
-    {  5, 56, 14.40, +51, 48, 14.0, 6.49 },
-    { 17, 41, 21.79, +51, 49,  5.2, 5.99 },
-    { 20,  5,  6.70, +51, 50, 21.8, 6.14 },
-    { 14, 25, 11.81, +51, 51,  2.9, 4.05 },
-    { 20, 34, 50.40, +51, 51, 15.1, 6.11 },
-    { 10, 59, 17.90, +51, 52, 55.9, 6.17 },
-    {  7, 24, 57.19, +51, 53, 13.9, 5.80 },
-    { 20, 48, 42.70, +51, 54, 38.2, 6.29 },
-    {  1, 50, 57.10, +51, 55, 59.9, 5.90 },
-    { 15, 20,  5.21, +51, 57, 31.0, 5.66 },
-    {  0, 24, 15.60, +52,  1, 12.0, 5.57 },
-    {  9, 34, 49.51, +52,  3,  5.0, 4.50 },
-    { 19, 59, 15.41, +52,  3, 20.9, 6.15 },
-    { 13, 43, 54.70, +52,  3, 51.8, 6.02 },
-    { 15, 36,  4.10, +52,  4, 10.9, 6.74 },
-    { 18, 32, 11.40, +52,  6, 56.2, 6.56 },
-    {  7, 17, 33.70, +52,  7, 50.9, 5.92 },
-    { 18, 39, 52.80, +52, 11, 46.0, 6.00 },
-    {  3,  8,  3.91, +52, 12, 47.9, 6.31 },
-    { 22, 23, 33.60, +52, 13, 45.1, 4.43 },
-    { 19,  2,  7.01, +52, 15, 40.0, 6.31 },
-    { 17, 30, 25.99, +52, 18,  5.0, 2.79 },
-    { 20, 31, 21.10, +52, 18, 34.9, 6.18 },
-    { 19, 27, 25.90, +52, 19, 14.2, 5.75 },
-    {  3,  0, 52.20, +52, 21,  6.1, 5.28 },
-    {  3,  0, 53.40, +52, 21,  7.9, 6.74 },
-    { 18, 33, 56.69, +52, 21, 13.0, 5.36 },
-    { 15, 42, 50.69, +52, 21, 38.9, 5.51 },
-    { 10,  5, 10.49, +52, 22, 14.9, 6.14 },
-    { 20, 47, 52.80, +52, 24, 25.9, 6.27 },
-    { 17, 10, 30.60, +52, 24, 32.0, 6.29 },
-    { 19,  8, 25.80, +52, 25, 32.2, 5.81 },
-    { 19, 55, 37.80, +52, 26, 20.0, 4.92 },
-    {  1,  4,  2.40, +52, 30,  7.9, 5.99 },
-    { 10, 52, 31.90, +52, 30, 13.0, 6.44 },
-    { 22, 44, 49.20, +52, 31,  1.9, 6.55 },
-    { 14, 15, 16.90, +52, 32,  8.9, 6.58 },
-    { 10, 52, 30.79, +52, 33, 55.1, 6.65 },
-    { 21, 31, 27.50, +52, 37, 12.0, 6.16 },
-    {  6, 11, 46.01, +52, 38, 49.9, 6.30 },
-    { 22, 59, 10.30, +52, 39, 15.8, 6.29 },
-    {  0, 53, 47.59, +52, 41, 21.1, 6.27 },
-    {  8, 39, 17.59, +52, 42, 42.1, 5.91 },
-    { 13, 27, 59.50, +52, 44, 44.9, 6.34 },
-    {  7,  5, 39.79, +52, 45, 29.2, 6.12 },
-    {  2, 54, 15.50, +52, 45, 45.0, 3.95 },
-    { 11, 16,  4.01, +52, 46, 23.2, 6.50 },
-    { 23,  7, 10.10, +52, 48, 59.0, 6.11 },
-    {  0, 31, 41.21, +52, 50, 21.8, 5.60 },
-    {  4, 53,  9.79, +52, 50, 26.9, 6.41 },
-    {  4, 56,  7.10, +52, 52,  9.8, 5.75 },
-    { 22,  1, 50.59, +52, 52, 55.9, 5.78 },
-    { 21, 26, 45.00, +52, 53, 55.0, 6.03 },
-    { 16, 36, 11.50, +52, 54,  1.1, 5.53 },
-    { 16,  2,  5.50, +52, 54, 56.9, 5.93 },
-    { 13, 39, 30.41, +52, 55, 17.0, 5.46 },
-    { 16, 36, 14.09, +52, 55, 27.1, 6.53 },
-    { 16, 36, 13.70, +52, 55, 27.8, 5.08 },
-    {  8, 39,   .00, +52, 55, 30.0, 6.42 },
-    { 21, 30, 20.40, +52, 57, 29.2, 6.02 },
-    { 18, 51, 34.99, +52, 58, 30.0, 5.51 },
-    { 18, 46, 43.10, +52, 59, 17.2, 5.88 },
-    { 19, 50, 37.70, +52, 59, 17.2, 5.03 },
-    { 20, 46, 21.19, +52, 59, 43.1, 6.33 },
-    {  2, 52, 52.01, +52, 59, 52.1, 6.36 },
-    {  0, 25,  6.41, +53,  2, 48.8, 5.74 },
-    { 12, 30, 50.11, +53,  4, 36.1, 6.21 },
-    {  4, 39, 54.70, +53,  4, 46.9, 5.05 },
-    {  8, 32, 33.50, +53,  6, 52.9, 6.24 },
-    {  4, 59, 46.30, +53,  9, 20.2, 6.08 },
-    { 20,  6, 13.80, +53,  9, 56.9, 5.85 },
-    { 12, 17, 29.50, +53, 11, 28.0, 5.81 },
-    { 23, 16, 42.29, +53, 12, 49.0, 5.54 },
-    {  5, 14, 44.30, +53, 12, 50.0, 6.20 },
-    {  8, 23, 48.50, +53, 13, 10.9, 5.51 },
-    { 21,  3, 47.59, +53, 17, 10.0, 5.90 },
-    {  6, 44, 11.59, +53, 17, 47.0, 6.27 },
-    { 18, 23, 47.81, +53, 18,  2.9, 6.32 },
-    { 22,  7, 25.51, +53, 18, 25.9, 6.14 },
-    { 19, 17,  6.19, +53, 22,  7.0, 3.77 },
-    { 19,  4, 55.20, +53, 23, 48.1, 5.38 },
-    {  8, 38, 22.20, +53, 24,  5.0, 5.66 },
-    { 17, 21, 45.41, +53, 25, 14.2, 5.67 },
-    { 12, 14, 43.39, +53, 26,  4.9, 6.16 },
-    {  6, 21, 46.10, +53, 27,  7.9, 5.36 },
-    {  4, 39, 58.10, +53, 28, 23.2, 5.35 },
-    {  5, 41, 20.30, +53, 28, 52.0, 6.23 },
-    { 10, 33, 43.61, +53, 29, 51.0, 6.45 },
-    {  1,  7,  9.50, +53, 29, 53.9, 6.38 },
-    {  3,  4, 47.81, +53, 30, 23.0, 2.93 },
-    {  2, 42, 59.69, +53, 31, 34.0, 5.84 },
-    { 20, 24, 32.40, +53, 33,  6.8, 6.51 },
-    { 21, 10, 15.60, +53, 33, 47.9, 5.73 },
-    {  8, 20, 29.09, +53, 34, 27.8, 6.49 },
-    {  5, 17, 17.81, +53, 35, 10.0, 6.50 },
-    { 20, 20, 30.41, +53, 35, 46.0, 6.18 },
-    {  4, 16, 43.10, +53, 36, 42.8, 5.19 },
-    { 10, 39,  5.69, +53, 40,  5.9, 5.52 },
-    { 11, 53, 49.80, +53, 41, 40.9, 2.44 },
-    { 13, 53, 51.00, +53, 43, 43.0, 5.70 },
-    {  4, 57, 17.21, +53, 45,  7.9, 4.47 },
-    { 10, 20, 14.81, +53, 46, 45.1, 6.45 },
-    { 17, 43, 59.30, +53, 48,  6.1, 5.75 },
-    {  2, 10,  7.80, +53, 50, 35.2, 6.31 },
-    { 22, 40, 18.41, +53, 50, 46.0, 5.93 },
-    {  1, 40, 13.10, +53, 52,  5.9, 6.39 },
-    { 18, 43, 28.99, +53, 52, 18.8, 6.11 },
-    { 10,  4, 36.29, +53, 53, 30.1, 5.74 },
-    {  0, 36, 58.30, +53, 53, 48.8, 3.66 },
-    { 22, 42, 20.81, +53, 54, 32.0, 6.12 },
-    {  4, 32,  1.80, +53, 54, 38.9, 5.77 },
-    {  3, 25, 48.41, +53, 55, 18.1, 6.51 },
-    { 15, 35, 16.30, +53, 55, 18.8, 5.97 },
-    { 21, 17,  1.99, +53, 59, 51.0, 6.13 },
-    {  4,  6, 36.60, +54,  0, 31.0, 6.31 },
-    { 15, 26, 32.50, +54,  1, 12.0, 6.45 },
-    {  9, 16, 11.30, +54,  1, 18.8, 4.83 },
-    { 14, 38, 15.19, +54,  1, 23.9, 5.85 },
-    { 22, 32, 18.79, +54,  2, 15.0, 6.35 },
-    { 21, 37, 38.71, +54,  2, 31.9, 6.15 },
-    {  9, 52,  6.41, +54,  3, 51.8, 4.59 },
-    { 12, 56, 17.59, +54,  5, 57.8, 5.82 },
-    {  7, 51,  5.71, +54,  7, 45.1, 6.02 },
-    {  8, 18, 15.79, +54,  8, 37.0, 6.27 },
-    {  0, 36,  8.30, +54, 10,  7.0, 5.08 },
-    { 10, 20, 31.20, +54, 13,   .8, 6.00 },
-    {  9,  4,   .41, +54, 17,  2.0, 5.75 },
-    {  5, 59, 31.61, +54, 17,  4.9, 3.72 },
-    { 18, 10, 31.61, +54, 17, 12.1, 5.95 },
-    { 11, 30, 12.91, +54, 21, 42.1, 6.41 },
-    {  9, 43,  7.01, +54, 21, 49.0, 6.47 },
-    { 19, 19, 36.50, +54, 22, 34.0, 6.26 },
-    {  5,  6, 22.01, +54, 24, 20.9, 7.24 },
-    { 22, 48, 47.81, +54, 24, 54.0, 6.12 },
-    {  5, 36, 35.21, +54, 25, 44.0, 5.73 },
-    { 13, 46, 35.69, +54, 25, 58.1, 5.70 },
-    { 17,  5, 19.80, +54, 28, 13.1, 5.83 },
-    { 17,  5, 19.70, +54, 28, 13.1, 5.80 },
-    {  2,  2, 18.10, +54, 29, 15.0, 5.04 },
-    { 15, 37, 31.99, +54, 30, 32.0, 5.87 },
-    {  0, 31, 46.39, +54, 31, 19.9, 4.73 },
-    {  5, 59, 48.10, +54, 32, 49.9, 6.14 },
-    { 15,  6, 16.70, +54, 33, 23.0, 5.25 },
-    { 10, 53, 34.51, +54, 35,  6.0, 5.10 },
-    { 15, 35, 57.10, +54, 37, 50.2, 5.74 },
-    { 13, 40, 44.30, +54, 40, 54.1, 4.66 },
-    { 15, 57, 47.40, +54, 44, 58.9, 4.95 },
-    { 11, 35,  4.90, +54, 47,  7.1, 5.63 },
-    {  4,  9, 22.39, +54, 49, 44.0, 6.18 },
-    { 14, 18, 55.80, +54, 51, 51.1, 6.53 },
-    { 21, 40, 43.30, +54, 52, 19.9, 6.20 },
-    { 11, 12, 44.50, +54, 53, 39.1, 6.63 },
-    {  0, 33, 10.39, +54, 53, 42.0, 5.93 },
-    { 18, 44, 55.39, +54, 53, 48.1, 6.23 },
-    {  1,  8, 16.39, +54, 55, 13.1, 5.17 },
-    { 13, 23, 56.40, +54, 55, 18.1, 3.95 },
-    { 13, 23, 55.49, +54, 55, 31.1, 2.27 },
-    { 19, 38, 41.21, +54, 58, 26.0, 5.82 },
-    {  3, 33, 39.00, +54, 58, 28.9, 5.98 },
-    { 13, 25, 13.49, +54, 59, 17.2, 4.01 },
-    {  2, 43,  2.81, +55,  6, 20.9, 5.77 },
-    {  1, 51, 59.30, +55,  8, 51.0, 5.52 },
-    {  1, 11,  6.19, +55,  8, 58.9, 4.33 },
-    { 11, 41, 43.61, +55, 10, 21.0, 6.27 },
-    { 17, 32, 16.01, +55, 10, 23.2, 4.87 },
-    { 17, 32, 10.61, +55, 11,  3.1, 4.88 },
-    { 15, 28, 56.81, +55, 11, 42.0, 6.43 },
-    { 16, 24, 25.30, +55, 12, 18.0, 5.74 },
-    {  7, 52, 36.60, +55, 12, 33.8, 6.38 },
-    {  0, 45, 17.21, +55, 13, 18.1, 5.42 },
-    { 23,  2, 43.80, +55, 14, 11.0, 6.50 },
-    {  4, 55,  3.10, +55, 15, 33.1, 5.52 },
-    {  7, 22, 52.10, +55, 16, 53.0, 5.45 },
-    {  7, 22, 50.90, +55, 17,  3.8, 6.53 },
-    {  0, 46, 15.10, +55, 18, 19.1, 6.52 },
-    {  5, 59, 45.70, +55, 19, 14.9, 6.44 },
-    { 13, 34,  7.30, +55, 20, 55.0, 5.60 },
-    {  6, 34, 32.81, +55, 21, 11.2, 6.45 },
-    {  2, 23, 51.79, +55, 21, 51.8, 6.28 },
-    { 15, 47, 37.99, +55, 22, 36.1, 5.86 },
-    { 20, 18, 24.79, +55, 23, 49.9, 5.76 },
-    { 14, 32, 30.91, +55, 23, 52.1, 5.76 },
-    { 21, 28, 52.70, +55, 25,  7.0, 6.12 },
-    {  3, 30,   .19, +55, 27,  6.8, 5.09 },
-    { 19, 42,  4.10, +55, 27, 47.9, 6.48 },
-    { 15, 46, 34.80, +55, 28, 28.9, 5.92 },
-    {  2, 29, 25.01, +55, 32, 11.0, 6.51 },
-    { 18, 42, 37.90, +55, 32, 21.8, 5.04 },
-    {  1, 53, 48.50, +55, 35, 53.2, 6.45 },
-    {  4, 48,  7.01, +55, 36,  9.0, 6.26 },
-    { 11, 46, 55.61, +55, 37, 41.9, 5.27 },
-    { 19,  0, 43.39, +55, 39, 29.9, 5.48 },
-    { 16, 42, 58.39, +55, 41, 25.1, 6.16 },
-    {  6, 48, 12.89, +55, 42, 15.8, 6.33 },
-    {  6, 48, 12.29, +55, 42, 15.8, 6.28 },
-    { 23, 57,  8.50, +55, 42, 20.9, 5.55 },
-    {  5, 54, 50.81, +55, 42, 24.8, 4.99 },
-    { 12, 27, 35.11, +55, 42, 46.1, 5.70 },
-    { 19, 31, 13.61, +55, 43, 54.8, 6.37 },
-    {  9, 29, 47.59, +55, 44, 44.2, 6.45 },
-    { 23, 59,   .50, +55, 45, 18.0, 4.88 },
-    {  7, 36, 46.99, +55, 45, 19.1, 5.92 },
-    { 21, 52,  1.01, +55, 47, 48.8, 5.71 },
-    { 21, 17, 14.30, +55, 47, 53.2, 5.98 },
-    { 23, 44, 48.31, +55, 47, 58.9, 6.51 },
-    { 15, 52, 16.61, +55, 49, 36.1, 5.81 },
-    { 16,  9, 25.99, +55, 49, 44.0, 6.49 },
-    {  2, 22, 21.41, +55, 50, 44.2, 5.17 },
-    { 11, 25, 57.10, +55, 51,  2.2, 5.75 },
-    { 13, 45, 13.20, +55, 52, 45.8, 6.50 },
-    {  2, 50, 41.81, +55, 53, 44.2, 3.76 },
-    { 22, 49, 46.20, +55, 54, 10.1, 5.43 },
-    {  3, 47, 32.21, +55, 55, 21.0, 6.10 },
-    { 12, 54,  1.70, +55, 57, 34.9, 1.77 },
-    { 17, 55, 23.71, +55, 58, 17.0, 6.10 },
-    { 10, 30, 37.61, +55, 58, 50.2, 4.84 },
-    { 20, 39,   .19, +56,  0, 18.0, 6.48 },
-    { 16, 38,   .41, +56,  0, 56.2, 5.29 },
-    { 20, 29, 27.10, +56,  4,  5.2, 5.91 },
-    {  3,  5, 39.89, +56,  4,  7.0, 6.11 },
-    { 22, 35, 51.79, +56,  4, 12.0, 6.38 },
-    {  5, 46, 30.41, +56,  6, 56.2, 5.94 },
-    {  6, 26, 25.80, +56, 17,  6.0, 5.64 },
-    { 20,  5, 21.50, +56, 20, 29.0, 6.21 },
-    { 22,  6, 13.49, +56, 20, 35.2, 6.39 },
-    { 13,  0, 43.80, +56, 21, 59.0, 4.93 },
-    { 11,  1, 50.50, +56, 22, 57.0, 2.37 },
-    { 22, 26, 59.21, +56, 25, 59.9, 6.57 },
-    {  8, 13, 50.21, +56, 27,  7.9, 5.85 },
-    { 20, 44, 22.01, +56, 29, 17.2, 5.78 },
-    {  7, 56, 26.81, +56, 30, 15.8, 6.72 },
-    {  4, 21, 51.79, +56, 30, 24.1, 5.88 },
-    {  0, 40, 30.50, +56, 32, 13.9, 2.23 },
-    { 20, 13, 23.90, +56, 34,  4.1, 4.30 },
-    {  5, 43,  1.61, +56, 34, 54.1, 6.05 },
-    { 10, 51, 11.09, +56, 34, 55.9, 5.67 },
-    { 18, 14, 41.11, +56, 35, 17.9, 6.37 },
-    { 11, 55, 58.39, +56, 35, 55.0, 5.84 },
-    {  2, 25, 16.01, +56, 36, 36.0, 6.25 },
-    { 21, 54, 53.21, +56, 36, 41.0, 5.80 },
-    { 22, 33, 40.61, +56, 37, 30.0, 5.71 },
-    { 20, 26, 23.50, +56, 38, 20.0, 6.36 },
-    { 21,  2,  9.10, +56, 40, 10.9, 5.83 },
-    { 19, 56, 19.01, +56, 41, 12.8, 6.12 },
-    { 16, 59, 21.50, +56, 41, 19.0, 6.03 },
-    {  9, 21, 43.30, +56, 41, 57.1, 5.47 },
-    {  3,  5, 32.40, +56, 42, 20.9, 4.76 },
-    { 11, 29, 43.49, +56, 44, 15.0, 6.28 },
-    {  9, 15, 49.90, +56, 44, 29.0, 5.27 },
-    {  4, 48,   .31, +56, 45, 25.9, 5.30 },
-    { 12, 25,  3.19, +56, 46, 39.0, 5.81 },
-    { 20, 31, 46.51, +56, 46, 48.0, 6.14 },
-    { 16, 45, 17.81, +56, 46, 54.8, 4.85 },
-    { 22, 38, 37.90, +56, 47, 44.9, 5.21 },
-    {  9, 59, 51.70, +56, 48, 42.8, 5.48 },
-    { 22, 11, 48.79, +56, 50, 21.8, 5.24 },
-    {  6, 37, 38.50, +56, 51, 27.0, 5.85 },
-    { 19, 11, 40.51, +56, 51, 33.1, 5.12 },
-    { 17, 53, 31.70, +56, 52, 22.1, 3.75 },
-    { 20, 56, 16.99, +56, 53, 15.0, 6.23 },
-    {  5, 50, 34.01, +56, 55,  8.0, 6.54 },
-    {  3, 38, 19.70, +56, 55, 58.1, 6.30 },
-    {  1,  7,   .19, +56, 56,  6.0, 6.43 },
-    { 23,  0,  5.09, +56, 56, 43.1, 5.00 },
-    { 12, 15, 25.61, +57,  1, 57.0, 3.31 },
-    { 19, 43, 39.60, +57,  2, 33.0, 6.27 },
-    { 22, 15,  1.99, +57,  2, 37.0, 4.19 },
-    { 18, 32, 34.49, +57,  2, 44.2, 4.77 },
-    { 12, 11, 44.90, +57,  3, 15.8, 6.43 },
-    {  2, 16, 51.70, +57,  3, 19.1, 6.48 },
-    { 14, 34, 15.91, +57,  3, 55.1, 6.48 },
-    { 11, 21, 49.30, +57,  4, 30.0, 6.43 },
-    {  7, 40, 49.51, +57,  4, 58.1, 6.06 },
-    { 10, 35,  9.70, +57,  4, 58.1, 5.16 },
-    {  2, 49, 30.79, +57,  5,  3.1, 6.25 },
-    {  1, 44, 46.10, +57,  5, 21.1, 6.25 },
-    { 23,  1, 30.70, +57,  6, 20.2, 6.20 },
-    { 20, 43, 13.49, +57,  6, 51.1, 6.32 },
-    {  3, 49, 19.61, +57,  7,  5.2, 6.46 },
-    {  9, 46, 31.70, +57,  7, 41.2, 5.20 },
-    {  3, 15, 48.00, +57,  8, 26.9, 5.79 },
-    {  0, 10, 29.69, +57,  9, 56.2, 6.74 },
-    { 23, 13, 16.99, +57, 10,  5.9, 5.56 },
-    {  6, 46, 49.51, +57, 10,  9.1, 5.35 },
-    { 10, 43, 43.30, +57, 11, 57.1, 5.80 },
-    { 13, 40, 21.29, +57, 12, 27.0, 6.29 },
-    { 22, 16, 26.50, +57, 13, 13.1, 5.88 },
-    {  5, 32, 33.79, +57, 13, 16.0, 6.48 },
-    { 23, 41, 54.50, +57, 15, 36.0, 6.24 },
-    {  8,  2, 35.81, +57, 16, 25.0, 6.49 },
-    { 22, 23,   .19, +57, 17,  3.8, 6.16 },
-    { 17, 40, 36.19, +57, 18, 37.1, 6.77 },
-    { 10, 46, 22.51, +57, 21, 56.9, 6.34 },
-    { 23, 55, 33.70, +57, 24, 43.9, 6.00 },
-    {  9, 57, 13.61, +57, 25,  5.9, 5.93 },
-    { 23, 47,  1.90, +57, 27,  5.0, 5.51 },
-    {  4, 15,  1.80, +57, 27, 37.1, 6.08 },
-    { 18, 53, 46.30, +57, 29, 12.8, 6.22 },
-    { 21, 38, 57.60, +57, 29, 21.1, 5.62 },
-    { 23, 54, 22.99, +57, 29, 57.8, 4.54 },
-    {  2, 18,  4.49, +57, 31,   .1, 5.98 },
-    { 19, 53, 17.40, +57, 31, 25.0, 5.14 },
-    {  1, 44, 17.90, +57, 32, 11.0, 6.21 },
-    {  5, 23, 27.79, +57, 32, 39.8, 5.28 },
-    { 17, 33, 31.70, +57, 33, 32.0, 6.17 },
-    {  6, 57, 13.20, +57, 33, 47.9, 6.05 },
-    { 20, 45, 21.10, +57, 34, 46.9, 4.51 },
-    {  4, 27,   .91, +57, 35,  7.1, 6.32 },
-    { 19, 20, 16.10, +57, 38, 43.1, 5.91 },
-    {  2, 11, 28.99, +57, 38, 44.9, 6.36 },
-    { 21, 59, 22.99, +57, 39, 29.9, 6.59 },
-    { 19, 13, 55.20, +57, 42, 18.0, 4.99 },
-    {  8, 20, 26.09, +57, 44, 35.9, 5.89 },
-    { 19, 21, 25.39, +57, 46,   .8, 6.43 },
-    { 18, 56, 45.00, +57, 48, 54.0, 5.66 },
-    {  0, 49,  6.00, +57, 48, 56.9, 3.44 },
-    {  4, 17,  8.21, +57, 51, 38.2, 5.71 },
-    { 12, 20, 50.81, +57, 51, 50.0, 5.55 },
-    {  3, 33, 41.21, +57, 52,  8.0, 6.37 },
-    { 17, 30, 43.80, +57, 52, 35.0, 6.40 },
-    {  2, 17, 59.90, +57, 53, 58.9, 5.75 },
-    { 15, 39,  9.50, +57, 55, 27.8, 6.45 },
-    { 16,  9,  2.90, +57, 56, 16.1, 6.33 },
-    { 11, 40, 27.41, +57, 58, 14.2, 6.37 },
-    {  3, 53, 43.30, +57, 58, 30.0, 5.80 },
-    {  1, 38,  7.61, +57, 58, 39.0, 5.56 },
-    {  0, 56, 12.91, +57, 59, 48.1, 6.21 },
-    { 22,  2,  4.61, +58,  0,  2.2, 5.56 },
-    { 19, 43, 14.59, +58,  0, 59.0, 6.22 },
-    { 19, 25, 46.70, +58,  1, 37.9, 6.60 },
-    {  5, 19, 27.79, +58,  7,  1.9, 6.13 },
-    {  1, 23, 21.60, +58,  8, 35.2, 6.45 },
-    {  6, 30, 47.21, +58,  9, 46.1, 5.88 },
-    { 22, 10, 51.29, +58, 12,  4.0, 3.35 },
-    { 18, 57, 28.39, +58, 13, 31.1, 6.46 },
-    {  1, 20,  4.90, +58, 13, 54.1, 4.98 },
-    {  8, 10,  3.79, +58, 14, 53.2, 5.93 },
-    { 19, 55, 22.10, +58, 15,  1.1, 6.09 },
-    {  1,  8, 33.31, +58, 15, 49.0, 5.79 },
-    {  2, 51, 45.50, +58, 18, 52.9, 6.45 },
-    {  1, 33, 25.80, +58, 19, 39.0, 5.70 },
-    { 12, 29, 57.31, +58, 24, 20.9, 5.35 },
-    { 22, 29, 10.30, +58, 24, 55.1, 3.75 },
-    {  6, 26, 48.91, +58, 25,  1.9, 5.21 },
-    {  6, 57, 16.49, +58, 25, 21.0, 4.35 },
-    {  2,  8, 40.51, +58, 25, 25.0, 5.67 },
-    {  0,  6, 16.01, +58, 26, 12.1, 5.96 },
-    { 22, 47, 23.21, +58, 28, 58.1, 6.36 },
-    { 13, 50, 27.70, +58, 32, 21.8, 6.46 },
-    { 23, 30,  1.99, +58, 32, 56.0, 4.91 },
-    {  2, 13, 41.50, +58, 33, 40.0, 6.44 },
-    { 23,  3, 21.60, +58, 33, 52.9, 6.43 },
-    { 16,  1, 53.30, +58, 33, 55.1, 4.01 },
-    { 21, 17, 18.79, +58, 36, 42.1, 6.42 },
-    { 21, 19, 15.79, +58, 37, 25.0, 5.66 },
-    {  1, 42, 17.81, +58, 37, 40.1, 6.37 },
-    { 17, 26,  4.90, +58, 39,  6.8, 6.51 },
-    { 23, 47,  3.50, +58, 39,  6.8, 4.87 },
-    {  7, 43,   .41, +58, 42, 37.1, 4.99 },
-    {  0, 42, 31.10, +58, 45, 11.9, 6.17 },
-    {  3, 33, 32.11, +58, 45, 54.0, 6.40 },
-    { 12, 30,  4.30, +58, 46,  3.0, 6.08 },
-    { 21, 43, 30.41, +58, 46, 48.0, 4.08 },
-    { 18, 23, 54.50, +58, 48,  2.2, 4.98 },
-    { 22,  7,  9.60, +58, 50, 26.9, 6.32 },
-    { 19, 55, 55.39, +58, 50, 46.0, 4.96 },
-    {  3, 29, 54.89, +58, 52, 43.0, 4.54 },
-    { 15, 55, 49.70, +58, 54, 42.1, 6.31 },
-    {  6,  9, 59.09, +58, 56,  8.9, 5.36 },
-    { 23, 49, 12.00, +58, 57, 47.2, 6.33 },
-    {  5, 52, 17.40, +58, 57, 51.1, 6.14 },
-    { 15, 24, 55.80, +58, 57, 58.0, 3.29 },
-    {  5,  6,  8.50, +58, 58, 21.0, 5.08 },
-    {  0, 55,   .10, +58, 58, 22.1, 4.83 },
-    {  6, 19, 37.39, +59,  0, 38.9, 4.48 },
-    {  5,  6, 12.19, +59,  1, 16.0, 6.08 },
-    {  9, 50, 59.40, +59,  2, 19.0, 3.80 },
-    {  8,  1, 20.71, +59,  2, 51.0, 5.77 },
-    {  8, 53,  5.90, +59,  3, 22.0, 6.25 },
-    { 22, 11, 56.90, +59,  5,  4.9, 6.30 },
-    {  0,  9, 10.70, +59,  8, 58.9, 2.27 },
-    {  4,  4, 27.19, +59,  9, 20.2, 5.06 },
-    {  0, 56, 39.79, +59, 10, 52.0, 4.63 },
-    {  1, 33, 55.90, +59, 13, 54.8, 4.71 },
-    { 21, 42, 45.41, +59, 16, 16.0, 6.08 },
-    { 14, 51, 26.40, +59, 17, 38.0, 5.46 },
-    { 10, 51, 23.71, +59, 19, 12.0, 5.58 },
-    { 23,  9, 44.09, +59, 19, 59.2, 5.70 },
-    { 14,  8, 46.01, +59, 20, 16.1, 6.46 },
-    {  9,  6, 43.10, +59, 20, 39.8, 6.45 },
-    {  3, 30, 11.30, +59, 21, 58.0, 6.13 },
-    {  6, 22,  3.60, +59, 22, 19.9, 5.94 },
-    { 18, 51, 12.10, +59, 23, 17.9, 4.66 },
-    {  6,  5,  8.30, +59, 23, 35.2, 6.34 },
-    {  5, 15, 11.30, +59, 24, 20.2, 6.15 },
-    { 16,  3,  9.31, +59, 24, 38.9, 6.19 },
-    { 22, 11, 30.70, +59, 24, 51.8, 5.04 },
-    { 23,  6, 36.89, +59, 25, 10.9, 4.85 },
-    { 20, 59, 25.39, +59, 26, 19.0, 5.51 },
-    {  6, 46, 14.09, +59, 26, 30.1, 4.87 },
-    {  6, 53,  5.09, +59, 26, 55.0, 5.33 },
-    { 12, 36, 23.30, +59, 29, 12.8, 5.50 },
-    {  4, 43, 18.10, +59, 31, 14.9, 6.50 },
-    { 18, 27, 42.29, +59, 32, 57.1, 6.43 },
-    {  0,  0, 30.89, +59, 33, 34.9, 6.19 },
-    {  8, 17, 50.40, +59, 34, 16.0, 5.64 },
-    {  0, 46, 42.41, +59, 34, 27.8, 6.39 },
-    { 20, 25,  5.09, +59, 36,   .0, 6.44 },
-    {  4, 22, 57.89, +59, 36, 59.0, 6.19 },
-    {  7, 15, 54.91, +59, 38, 15.0, 5.20 },
-    { 19, 53, 35.40, +59, 42, 32.0, 6.06 },
-    { 13,  2, 40.39, +59, 42, 58.0, 6.53 },
-    { 23,  7, 10.39, +59, 43, 39.0, 6.40 },
-    { 21, 27, 25.30, +59, 45,   .0, 6.10 },
-    { 16, 17, 15.31, +59, 45, 18.0, 5.40 },
-    {  7,  6,  1.30, +59, 48,  6.8, 6.44 },
-    { 22, 59,  9.00, +59, 48, 52.9, 6.43 },
-    {  5, 54, 57.79, +59, 53, 17.9, 5.20 },
-    {  7, 22, 17.21, +59, 54,  6.8, 6.35 },
-    {  4,  9, 27.60, +59, 54, 29.2, 6.28 },
-    {  8, 39, 10.20, +59, 56, 21.8, 6.48 },
-    {  3, 29,  4.10, +59, 56, 25.1, 4.21 },
-    { 13, 28, 27.10, +59, 56, 44.9, 5.40 },
-    {  3, 42, 42.70, +59, 58,  9.8, 5.76 },
-    {  0, 30, 19.90, +59, 58, 37.9, 5.94 },
-    { 23, 48, 53.90, +59, 58, 44.0, 6.34 },
-    { 10, 15,  7.70, +59, 59,  8.2, 6.25 },
-    { 21, 11, 48.19, +59, 59, 11.0, 5.64 },
-    {  6, 15, 40.61, +59, 59, 57.1, 5.35 },
-    { 23, 57, 33.50, +60,  1, 25.0, 6.47 },
-    {  3, 35,   .79, +60,  2, 28.0, 6.46 },
-    { 17, 25, 41.30, +60,  2, 53.9, 5.65 },
-    { 22, 53,  3.79, +60,  6,  4.0, 6.01 },
-    { 23, 22, 32.50, +60,  8,  1.0, 5.56 },
-    { 19, 33, 10.10, +60,  9, 31.0, 6.29 },
-    { 15,  1, 27.10, +60, 12, 15.8, 5.93 },
-    { 14, 31, 42.79, +60, 13, 32.2, 6.27 },
-    {  1, 25, 49.01, +60, 14,  7.1, 2.68 },
-    {  3, 28, 23.59, +60, 15, 20.2, 6.49 },
-    { 12, 48, 39.41, +60, 19, 12.0, 5.85 },
-    {  8,  1, 42.41, +60, 19, 27.8, 6.01 },
-    {  0, 36, 27.31, +60, 19, 34.0, 5.79 },
-    {  0, 56, 47.09, +60, 21, 46.1, 5.55 },
-    {  8, 15, 50.50, +60, 22, 50.2, 6.45 },
-    { 18, 11,  7.10, +60, 24, 33.8, 6.49 },
-    {  5,  3, 25.10, +60, 26, 31.9, 4.03 },
-    { 23,  3, 23.71, +60, 26, 43.1, 6.74 },
-    { 21, 30, 59.30, +60, 27, 33.8, 5.53 },
-    { 20, 40, 17.90, +60, 30, 19.1, 6.01 },
-    { 19, 40, 13.01, +60, 30, 25.9, 6.51 },
-    {  1, 43, 19.70, +60, 33,  4.0, 5.78 },
-    { 20, 42, 39.70, +60, 36,  5.0, 6.15 },
-    {  8, 22, 44.09, +60, 37, 52.0, 6.41 },
-    { 20, 13, 27.70, +60, 38, 26.2, 5.79 },
-    { 17,  1, 16.70, +60, 38, 57.1, 6.13 },
-    { 15, 27, 51.41, +60, 40, 13.1, 5.90 },
-    { 17, 16, 29.40, +60, 40, 14.2, 6.32 },
-    { 21, 47, 25.30, +60, 41, 34.1, 5.52 },
-    {  0, 56, 42.50, +60, 43,   .1, 2.47 },
-    {  8, 30, 15.91, +60, 43,  5.2, 3.36 },
-    {  4, 21, 47.59, +60, 44,  8.2, 5.39 },
-    { 21, 20, 33.50, +60, 45, 24.8, 6.11 },
-    { 22, 12,  1.90, +60, 45, 33.8, 5.35 },
-    { 16, 32, 25.70, +60, 49, 23.9, 5.94 },
-    {  1, 42,  3.00, +61,  2, 17.9, 6.71 },
-    { 18, 44, 18.19, +61,  2, 53.2, 5.99 },
-    {  1,  3, 37.01, +61,  4, 30.0, 5.92 },
-    {  5,  1, 35.90, +61,  4, 41.2, 6.03 },
-    { 11, 32, 20.81, +61,  4, 57.0, 5.48 },
-    {  3, 57,  8.30, +61,  6, 32.0, 5.00 },
-    {  9, 55,  3.41, +61,  6, 58.0, 6.27 },
-    { 21, 45, 26.90, +61,  7, 14.9, 4.29 },
-    {  0, 53,  4.10, +61,  7, 27.1, 4.82 },
-    { 12, 43,  4.20, +61,  9, 20.2, 6.38 },
-    {  5,  6, 29.69, +61, 10, 12.0, 6.04 },
-    {  0,  1, 36.91, +61, 13, 23.2, 5.55 },
-    { 14, 42,  3.19, +61, 15, 42.8, 6.25 },
-    { 21, 49, 19.01, +61, 16, 22.1, 6.17 },
-    {  0,  5,  6.19, +61, 18, 51.1, 5.80 },
-    {  1, 42, 58.39, +61, 25, 18.1, 6.34 },
-    {  9, 14, 20.59, +61, 25, 23.9, 5.13 },
-    { 11, 58, 20.59, +61, 27, 52.9, 6.76 },
-    {  5, 44,  8.59, +61, 28, 36.1, 6.15 },
-    {  6, 37, 41.40, +61, 28, 52.0, 5.94 },
-    { 13, 49, 45.50, +61, 29, 21.1, 5.96 },
-    { 13, 57, 32.09, +61, 29, 34.1, 6.37 },
-    { 16, 23, 59.50, +61, 30, 51.1, 2.74 },
-    {  6, 17, 54.79, +61, 30, 55.1, 4.98 },
-    {  2, 55, 56.90, +61, 31, 16.0, 5.59 },
-    {  0, 16, 57.10, +61, 31, 59.9, 5.74 },
-    { 21, 55, 20.69, +61, 32, 30.8, 6.13 },
-    { 11, 56, 53.21, +61, 32, 57.1, 6.22 },
-    {  1,  4, 19.61, +61, 34, 49.1, 5.84 },
-    { 23, 42, 31.51, +61, 40, 45.8, 6.40 },
-    { 16, 23, 46.99, +61, 41, 48.1, 5.67 },
-    { 22, 51, 22.80, +61, 41, 48.8, 5.60 },
-    {  1, 58, 33.31, +61, 41, 53.2, 6.02 },
-    {  1, 13,  9.91, +61, 42, 20.9, 6.41 },
-    { 11,  3, 43.70, +61, 45,  2.9, 1.79 },
-    { 11, 29,  4.61, +61, 46, 41.9, 5.83 },
-    {  0, 51, 16.39, +61, 48, 20.9, 6.07 },
-    {  0, 24, 47.50, +61, 49, 52.0, 5.40 },
-    { 20, 45, 17.40, +61, 50, 20.0, 3.43 },
-    {  5, 13,  3.19, +61, 51,   .0, 6.17 },
-    {  4, 16, 53.59, +61, 51,  1.1, 5.70 },
-    { 17, 34, 59.50, +61, 52, 30.0, 5.23 },
-    {  8, 53, 22.61, +61, 57, 43.9, 5.73 },
-    { 23, 16, 26.81, +61, 57, 47.2, 6.53 },
-    { 23, 20, 14.30, +61, 58, 12.0, 6.45 },
-    { 20,  5, 32.81, +61, 59, 44.2, 5.39 },
-    { 13,  6, 22.70, +62,  2, 30.8, 6.14 },
-    { 15, 22, 37.30, +62,  2, 49.9, 5.98 },
-    { 20, 11, 34.90, +62,  4, 43.0, 5.75 },
-    { 21, 37, 55.20, +62,  4, 54.8, 4.73 },
-    { 15, 29, 21.19, +62,  5, 58.9, 6.38 },
-    { 23, 20, 34.61, +62, 12, 47.2, 6.39 },
-    { 23, 48, 50.21, +62, 12, 51.8, 5.43 },
-    { 13,  9, 50.21, +62, 13, 45.1, 6.54 },
-    { 20, 19, 36.70, +62, 15, 27.0, 5.72 },
-    { 15, 27, 40.80, +62, 16, 32.2, 6.50 },
-    { 22,  5,  8.90, +62, 16, 48.0, 5.11 },
-    { 23, 24, 50.30, +62, 16, 58.1, 4.98 },
-    {  0,  4, 13.61, +62, 17, 16.1, 5.88 },
-    {  4,  7, 51.10, +62, 19, 48.0, 6.99 },
-    { 18, 57, 17.40, +62, 23, 48.1, 6.45 },
-    { 22, 23,   .19, +62, 25, 12.0, 6.04 },
-    { 21, 44, 53.30, +62, 27, 38.2, 5.95 },
-    { 22,  0, 39.31, +62, 29, 17.2, 6.66 },
-    {  8, 19, 17.30, +62, 30, 25.9, 5.71 },
-    { 18, 37, 33.50, +62, 31, 36.1, 5.74 },
-    { 19, 26, 26.50, +62, 33, 25.9, 6.38 },
-    { 21, 18, 34.80, +62, 35,  8.2, 2.44 },
-    { 15, 46, 40.01, +62, 35, 57.8, 5.19 },
-    {  5, 20, 22.61, +62, 39, 13.0, 5.61 },
-    {  5, 13, 31.30, +62, 41, 29.0, 6.50 },
-    { 21, 58, 53.40, +62, 41, 53.9, 5.93 },
-    { 12, 41, 33.91, +62, 42, 47.2, 6.07 },
-    { 18, 40, 56.30, +62, 44, 58.9, 6.09 },
-    {  1,  6, 22.80, +62, 45, 42.1, 6.54 },
-    { 12, 47, 18.91, +62, 46, 50.9, 5.89 },
-    { 22,  5,   .50, +62, 47,  8.2, 5.27 },
-    { 22, 18, 12.70, +62, 48, 15.8, 5.75 },
-    {  5, 49,  4.90, +62, 48, 29.2, 6.13 },
-    {  7, 46, 27.41, +62, 49, 50.2, 6.49 },
-    { 17, 12, 32.59, +62, 52, 27.8, 5.56 },
-    {  0, 33,   .00, +62, 55, 54.1, 4.16 },
-    { 12,  5, 39.70, +62, 55, 59.2, 6.13 },
-    { 22, 48, 44.21, +62, 56, 17.9, 6.06 },
-    { 20, 29, 34.90, +62, 59, 39.1, 4.22 },
-    {  9, 31, 31.70, +63,  3, 42.8, 3.67 },
-    {  5, 30, 10.20, +63,  4,  1.9, 5.42 },
-    {  3, 57, 25.51, +63,  4, 19.9, 5.03 },
-    { 16, 36, 55.01, +63,  4, 22.1, 6.16 },
-    {  8,  2, 30.79, +63,  5, 25.1, 6.40 },
-    { 22,  3, 52.90, +63,  7, 10.9, 5.29 },
-    { 22, 13, 49.49, +63,  9, 45.0, 6.11 },
-    { 14, 30, 46.10, +63, 11,  8.2, 6.09 },
-    {  3, 42,  9.29, +63, 13,   .1, 5.10 },
-    { 13, 25, 59.90, +63, 15, 40.0, 6.50 },
-    { 22, 12, 22.30, +63, 17, 29.0, 5.79 },
-    { 21,  9, 28.90, +63, 17, 44.2, 6.54 },
-    {  3, 49, 36.70, +63, 17, 49.9, 5.85 },
-    { 15, 22, 38.40, +63, 20, 29.0, 5.79 },
-    {  3, 46,  2.30, +63, 20, 42.0, 4.80 },
-    { 11,  1,  5.81, +63, 25, 16.0, 6.39 },
-    {  6,  6, 39.19, +63, 27, 13.0, 6.39 },
-    {  4, 52,  5.21, +63, 30, 19.1, 5.44 },
-    {  9, 10, 55.10, +63, 30, 49.0, 4.67 },
-    { 19, 58, 28.70, +63, 32,  3.1, 5.96 },
-    { 22, 38, 39.00, +63, 35,  3.8, 5.19 },
-    { 13,  1, 46.80, +63, 36, 37.1, 6.00 },
-    { 21, 56, 39.10, +63, 37, 32.2, 4.91 },
-    { 23,  7, 47.71, +63, 37, 59.9, 6.26 },
-    {  0,  3, 25.70, +63, 38, 30.8, 6.24 },
-    {  9, 45, 55.39, +63, 39, 11.9, 6.34 },
-    {  1, 54, 23.69, +63, 40, 12.0, 3.38 },
-    { 12, 25,  6.41, +63, 48, 10.1, 6.32 },
-    {  1, 47, 44.81, +63, 51,  7.9, 5.63 },
-    { 20,  4, 44.59, +63, 53, 26.2, 6.26 },
-    {  9, 25, 44.21, +63, 56, 26.9, 6.28 },
-    { 20, 21, 11.40, +63, 58, 49.1, 5.69 },
-    { 20, 49, 17.40, +64,  2, 31.9, 6.45 },
-    {  3,  7, 19.01, +64,  3, 28.1, 5.89 },
-    { 22, 28, 19.70, +64,  5,  8.2, 6.29 },
-    {  0, 25, 17.90, +64,  8, 36.0,      },
-    {  5, 37, 15.10, +64,  9, 16.9, 6.15 },
-    {  0,  6, 26.50, +64, 11, 46.0, 5.59 },
-    {  1, 11, 25.61, +64, 12, 10.1, 5.55 },
-    { 15, 30, 55.70, +64, 12, 31.0, 5.79 },
-    { 23,  7, 57.19, +64, 13, 21.0, 6.21 },
-    {  0, 50, 43.61, +64, 14, 51.0, 5.39 },
-    { 10, 30, 26.59, +64, 15, 27.0, 6.12 },
-    {  4, 36, 24.19, +64, 15, 42.1, 5.94 },
-    {  8, 40, 12.79, +64, 19, 40.1, 4.60 },
-    { 11, 22, 51.29, +64, 19, 50.2, 6.02 },
-    {  2, 56, 24.79, +64, 19, 57.0, 6.24 },
-    {  2, 20, 12.89, +64, 20, 13.9, 6.60 },
-    { 11, 38, 49.20, +64, 20, 48.8, 6.46 },
-    { 14,  4, 23.30, +64, 22, 32.9, 3.65 },
-    {  2,  3,   .29, +64, 23, 24.0, 5.58 },
-    { 19, 19, 46.10, +64, 23, 26.9, 6.52 },
-    { 18, 13, 53.81, +64, 23, 49.9, 5.03 },
-    { 21, 13, 42.60, +64, 24, 14.0, 6.39 },
-    { 23, 42, 20.81, +64, 30, 56.2, 6.56 },
-    {  3, 24, 40.51, +64, 35, 10.0, 5.23 },
-    { 16, 40, 55.10, +64, 35, 21.1, 4.83 },
-    { 17,  2, 15.31, +64, 36,  2.2, 6.10 },
-    {  8, 56, 37.49, +64, 36, 14.0, 5.58 },
-    {  1, 59, 37.99, +64, 37, 17.0, 5.26 },
-    { 22,  3, 47.40, +64, 37, 40.1, 4.29 },
-    { 20,  2, 20.30, +64, 38,  3.8, 6.57 },
-    {  1, 21,  5.21, +64, 39, 29.9, 6.34 },
-    { 13, 27, 10.70, +64, 43,  9.8, 7.04 },
-    { 13, 51, 25.90, +64, 43, 23.9, 4.65 },
-    { 13, 27,  4.61, +64, 44,  8.2, 6.66 },
-    { 20,  1, 28.49, +64, 49, 16.0, 5.27 },
-    { 13, 41, 29.90, +64, 49, 21.0, 5.85 },
-    {  9, 12,  2.60, +64, 51, 47.0,      },
-    { 21, 19, 22.20, +64, 52, 18.8, 5.18 },
-    { 23, 48, 39.00, +64, 52, 35.0, 6.41 },
-    {  2,  2, 52.70, +64, 54,  5.0, 6.00 },
-    {  5,  9, 44.50, +64, 55,  9.8, 6.41 },
-    {  9, 44, 36.70, +64, 59,  2.0, 6.17 },
-    {  1, 11, 41.40, +65,  1,  8.0, 5.57 },
-    {  8, 39, 11.71, +65,  1, 14.9, 5.64 },
-    { 16, 56, 25.20, +65,  2, 21.1, 6.41 },
-    {  2,  4, 40.10, +65,  6, 11.9, 6.52 },
-    { 10, 18,  1.99, +65,  6, 29.9, 5.82 },
-    { 10, 48, 49.99, +65,  7, 55.9, 6.39 },
-    { 22, 27,  5.30, +65,  7, 55.9, 5.46 },
-    { 16, 56,  1.70, +65,  8,  4.9, 4.89 },
-    {  4, 20, 40.30, +65,  8, 26.2, 5.27 },
-    {  8, 34, 36.19, +65,  8, 42.0, 5.47 },
-    { 18, 56, 25.61, +65, 15, 29.2, 5.63 },
-    { 21, 55, 31.10, +65, 19, 14.9, 5.86 },
-    { 18, 31, 14.81, +65, 26, 10.0, 6.59 },
-    { 12, 55, 28.49, +65, 26, 19.0, 5.24 },
-    {  7, 46, 40.10, +65, 27, 20.9, 5.92 },
-    { 18, 36, 13.30, +65, 29, 19.0, 6.06 },
-    {  4,  6, 39.00, +65, 31, 14.9, 6.17 },
-    {  3, 49, 31.20, +65, 31, 34.0, 4.47 },
-    { 18, 25, 59.09, +65, 33, 49.0, 4.82 },
-    { 10, 24,  7.90, +65, 33, 59.0, 4.97 },
-    {  9, 50, 23.71, +65, 35, 35.9, 6.31 },
-    { 10, 29, 54.31, +65, 37, 34.0, 6.32 },
-    {  3, 19, 59.40, +65, 39,  7.9, 4.84 },
-    {  3, 17, 31.61, +65, 39, 31.0, 6.36 },
-    {  5, 42, 26.40, +65, 41, 52.1, 5.60 },
-    { 19, 20, 40.10, +65, 42, 52.9, 4.59 },
-    { 17,  8, 47.21, +65, 42, 52.9, 3.17 },
-    { 10, 41, 56.59, +65, 42, 59.0, 5.12 },
-    {  6, 12, 51.10, +65, 43,  5.9, 5.32 },
-    {  2, 37, 36.10, +65, 44, 44.2, 5.78 },
-    { 21, 51, 37.30, +65, 45, 10.1, 6.37 },
-    { 15,  3, 57.79, +65, 55, 10.9, 6.13 },
-    { 14, 57, 34.99, +65, 55, 57.0, 4.60 },
-    { 19,  9, 45.79, +65, 58, 43.0, 6.25 },
-    {  5, 57, 34.99, +66,  5, 46.0, 6.25 },
-    {  1, 30, 52.30, +66,  5, 53.2, 6.14 },
-    {  0,  2, 36.10, +66,  5, 56.0, 5.86 },
-    {  0, 42,  3.41, +66,  8, 51.0, 5.83 },
-    { 21, 57, 11.11, +66,  9, 22.0, 6.43 },
-    { 22, 49, 40.80, +66, 12,  2.2, 3.52 },
-    {  7, 27, 25.80, +66, 19, 54.1, 6.47 },
-    {  4, 54,  3.00, +66, 20, 34.1, 4.29 },
-    {  0, 58, 31.10, +66, 21,  7.9, 5.97 },
-    {  0, 31, 25.30, +66, 31,  9.8, 6.18 },
-    {  2, 14, 29.11, +66, 31, 27.8, 6.07 },
-    { 12, 59, 55.10, +66, 35, 49.9, 5.32 },
-    { 20, 43, 10.99, +66, 39, 27.0, 5.58 },
-    {  5, 37, 16.20, +66, 41, 46.0, 6.26 },
-    {  8, 48, 49.39, +66, 42, 29.2, 6.20 },
-    {  0,  3, 51.91, +66, 42, 43.9, 6.29 },
-    { 11, 42, 28.39, +66, 44, 42.0, 5.30 },
-    {  0, 34, 24.91, +66, 45,  1.1, 6.48 },
-    { 23, 46, 36.70, +66, 46, 55.9, 5.95 },
-    { 12, 47, 34.39, +66, 47, 25.1, 5.43 },
-    { 21, 27, 46.10, +66, 48, 33.1, 5.44 },
-    {  5,  2, 50.40, +66, 49, 22.1, 6.19 },
-    { 20, 17, 31.30, +66, 51, 14.0, 5.93 },
-    {  9,  8, 23.59, +66, 52, 23.9, 5.14 },
-    { 11, 20, 53.81, +67,  6,  2.2, 6.21 },
-    {  9, 10, 23.21, +67,  8,  4.9, 4.80 },
-    { 16, 12, 25.10, +67,  8, 39.1, 6.21 },
-    {  0,  4, 42.00, +67, 10,   .1, 5.67 },
-    {  3, 46,   .89, +67, 12,  6.1, 5.80 },
-    { 23,  3, 32.90, +67, 12, 33.1, 5.24 },
-    { 11,  9, 39.89, +67, 12, 37.1, 6.06 },
-    {  9, 39, 27.91, +67, 16, 19.9, 5.94 },
-    {  8, 29, 46.20, +67, 17, 51.0, 5.88 },
-    { 17, 25,   .19, +67, 18, 23.0, 6.43 },
-    { 15, 14, 38.30, +67, 20, 48.1, 5.13 },
-    {  2, 29,  4.01, +67, 24,  9.0, 4.52 },
-    { 10, 45,  4.01, +67, 24, 41.0, 6.00 },
-    {  6, 50, 57.10, +67, 34, 18.8, 5.14 },
-    {  9,  2, 32.69, +67, 37, 46.9, 4.76 },
-    { 19, 12, 33.31, +67, 39, 42.1, 3.07 },
-    { 15, 10, 44.09, +67, 46, 53.0, 6.17 },
-    { 23, 47, 54.79, +67, 48, 24.8, 5.04 },
-    { 16,  6, 19.70, +67, 48, 37.1, 5.44 },
-    {  2, 44, 49.70, +67, 49, 28.9, 5.95 },
-    { 20,  2, 49.10, +67, 52, 25.0, 4.51 },
-    { 20,  4, 53.30, +68,  1, 37.9, 6.28 },
-    {  1, 42, 20.50, +68,  2, 35.2, 5.59 },
-    { 23, 18, 37.49, +68,  6, 42.1, 4.75 },
-    {  1, 25, 55.99, +68,  7, 48.0, 4.74 },
-    { 17, 31, 57.89, +68,  8,  6.0, 5.05 },
-    { 11, 12, 10.99, +68, 16, 18.8, 6.40 },
-    { 13, 50, 59.21, +68, 18, 55.1, 6.40 },
-    { 13, 16, 28.61, +68, 24, 29.2, 6.20 },
-    { 19, 46, 44.69, +68, 26, 17.9, 6.34 },
-    { 10, 41, 48.29, +68, 26, 35.9, 5.75 },
-    {  7, 30, 52.70, +68, 27, 56.2, 5.64 },
-    {  5, 52, 55.49, +68, 28, 17.0, 6.20 },
-    {  8, 12, 48.79, +68, 28, 27.1, 5.32 },
-    { 21,  9, 31.99, +68, 29, 25.1, 7.33 },
-    {  4, 12, 51.60, +68, 30,  6.1, 6.32 },
-    {  3, 51, 41.81, +68, 30, 27.0, 6.32 },
-    { 16, 18,  9.41, +68, 33, 15.8, 6.41 },
-    { 22, 49,   .70, +68, 34, 13.1, 6.19 },
-    { 14,  1, 50.59, +68, 40, 43.0, 6.34 },
-    {  4,  6,  3.10, +68, 40, 48.0, 5.87 },
-    {  1, 56,   .00, +68, 41,  7.1, 4.99 },
-    { 10, 21,  3.41, +68, 44, 51.0, 5.96 },
-    { 18, 15, 16.99, +68, 45, 20.9, 5.95 },
-    { 17, 36, 57.10, +68, 45, 29.2, 4.80 },
-    { 16, 27, 58.99, +68, 46,  5.2, 5.00 },
-    {  0, 56, 55.61, +68, 46, 34.0, 6.37 },
-    {  1, 10, 39.29, +68, 46, 43.0, 5.29 },
-    { 20, 20,  6.00, +68, 52, 49.1, 5.55 },
-    {  6, 53, 42.19, +68, 53, 17.9, 5.12 },
-    {  2, 51, 58.70, +68, 53, 19.0, 5.80 },
-    { 15, 14, 51.89, +68, 56, 43.1, 6.51 },
-    { 10, 43,  4.10, +69,  4, 34.0, 5.00 },
-    { 16, 21, 48.70, +69,  6, 33.8, 5.25 },
-    { 16, 59,  2.59, +69, 11, 11.0, 6.40 },
-    { 12, 30,  6.70, +69, 12,  4.0, 4.95 },
-    {  9, 42, 14.81, +69, 14, 15.0, 5.69 },
-    { 15, 37, 39.10, +69, 16, 59.9, 5.62 },
-    {  6, 18, 50.81, +69, 19, 10.9, 4.80 },
-    {  8, 32, 53.40, +69, 19, 12.0, 6.31 },
-    { 11, 36,  2.81, +69, 19, 22.1, 5.20 },
-    {  0, 46, 39.00, +69, 19, 30.0, 6.33 },
-    { 11, 31, 24.19, +69, 19, 52.0, 3.84 },
-    { 19, 44, 18.50, +69, 20, 12.8, 5.92 },
-    { 14, 12,  4.01, +69, 25, 57.0, 5.24 },
-    { 18, 58, 52.61, +69, 31, 52.0, 6.52 },
-    { 17, 36, 39.70, +69, 34, 14.9, 6.42 },
-    {  2, 48, 55.51, +69, 38,  3.1, 6.18 },
-    {  5,  9, 36.70, +69, 38, 21.8, 6.41 },
-    { 19, 32, 21.60, +69, 39, 40.0, 4.68 },
-    { 20, 44, 33.10, +69, 45,  6.8, 6.41 },
-    { 12, 33, 28.99, +69, 47, 17.9, 3.87 },
-    {  9, 34, 28.90, +69, 49, 49.1, 4.56 },
-    { 10, 53, 30.70, +69, 51, 14.0, 5.93 },
-    { 22, 33,  2.90, +69, 54, 49.0, 6.60 },
-    { 12, 34, 43.99, +70,  1, 18.8, 4.94 },
-    { 22, 10, 38.90, +70,  7, 58.1, 5.50 },
-    { 21, 47,  1.01, +70,  9,  2.9, 6.29 },
-    { 12, 15,  8.50, +70, 12,   .0, 5.71 },
-    {  1, 31, 13.80, +70, 15, 52.9, 5.81 },
-    { 19, 48, 10.39, +70, 16,  4.1, 3.83 },
-    { 23, 27, 16.61, +70, 21, 34.9, 5.60 },
-    { 19, 58, 41.90, +70, 22,   .8, 6.33 },
-    { 22, 33, 16.99, +70, 22, 26.0, 6.34 },
-    {  6, 28, 14.59, +70, 32,  8.2, 5.97 },
-    { 21, 28, 39.60, +70, 33, 38.9, 3.23 },
-    {  1, 42, 55.90, +70, 37, 21.0, 5.18 },
-    {  7,  5, 51.79, +70, 43, 54.8, 6.50 },
-    { 22, 26,   .79, +70, 46, 14.9, 5.47 },
-    { 18, 43, 10.20, +70, 47, 34.1, 6.44 },
-    {  7,  1, 21.50, +70, 48, 29.2, 5.68 },
-    {  3, 49, 13.80, +70, 52, 16.0, 5.44 },
-    { 23, 15, 37.80, +70, 53, 17.2, 5.56 },
-    {  2,  1, 57.41, +70, 54, 24.8, 4.54 },
-    {  4, 50, 36.41, +70, 56, 30.1, 6.37 },
-    {  1, 25, 46.51, +70, 58, 48.0, 6.49 },
-    {  0, 33, 19.30, +70, 58, 54.1, 6.42 },
-    {  1,  0, 31.01, +70, 58, 59.2, 6.39 },
-    { 19, 31,   .19, +70, 59, 21.8, 6.07 },
-    { 10, 17, 50.59, +71,  3, 38.2, 6.66 },
-    { 13, 37, 10.99, +71, 14, 31.9, 5.50 },
-    { 18, 54, 23.90, +71, 17, 49.9, 4.82 },
-    { 21, 41, 55.30, +71, 18, 41.0, 4.56 },
-    {  3, 50, 21.50, +71, 19, 55.9, 4.63 },
-    { 18, 20, 45.50, +71, 20, 16.1, 4.22 },
-    { 21,  6, 23.30, +71, 25, 54.8, 5.87 },
-    { 23, 34, 58.99, +71, 38, 31.9, 5.84 },
-    {  9, 14,  3.19, +71, 39, 20.9, 6.55 },
-    {  1, 16, 12.10, +71, 44, 38.0, 7.83 },
-    {  6, 40, 32.21, +71, 44, 56.0, 5.92 },
-    {  7, 13, 58.10, +71, 49,   .1, 6.35 },
-    {  3, 56, 30.19, +71, 49, 18.1, 6.34 },
-    { 15, 17,  5.90, +71, 49, 26.0, 5.02 },
-    { 15, 20, 43.70, +71, 50,  2.0, 3.05 },
-    {  3, 30, 19.49, +71, 51, 50.0, 6.32 },
-    { 12, 26, 24.19, +71, 55, 46.9, 6.24 },
-    { 17, 55, 11.21, +72,  0, 18.0, 5.45 },
-    { 22, 10, 15.31, +72,  6, 40.0, 6.37 },
-    {  4, 13, 44.90, +72,  7, 35.0, 6.03 },
-    { 17, 41, 56.30, +72,  8, 56.0, 4.58 },
-    { 17, 41, 58.01, +72,  9, 24.8, 5.79 },
-    {  9, 34, 53.59, +72, 12, 20.2, 5.72 },
-    {  9, 42, 57.19, +72, 15,  9.0, 5.17 },
-    { 21, 43,  4.01, +72, 19, 13.1, 5.17 },
-    { 22,  9, 48.41, +72, 20, 28.0, 4.79 },
-    { 13, 26,  8.11, +72, 23, 29.0, 5.79 },
-    {  8, 20, 40.30, +72, 24, 25.9, 5.98 },
-    {  2,  3, 26.09, +72, 25, 17.0, 3.98 },
-    { 17, 37,  8.81, +72, 27, 20.9, 5.86 },
-    {  4, 33, 30.70, +72, 31, 43.0, 5.94 },
-    { 20, 30,   .70, +72, 31, 54.1, 6.27 },
-    { 12, 15, 41.40, +72, 33,  2.9, 6.29 },
-    { 16, 31, 28.10, +72, 36, 42.8, 6.30 },
-    {  0, 48,  9.10, +72, 40, 30.0, 5.87 },
-    { 18, 21,  3.41, +72, 43, 58.1, 3.57 },
-    { 13, 13, 31.99, +72, 47, 56.0, 6.59 },
-    {  2, 38,  1.99, +72, 49,  5.9, 5.16 },
-    {  9, 58, 22.80, +72, 52, 45.8, 5.83 },
-    {  9, 15, 52.61, +72, 56, 46.0, 5.96 },
-    { 13,  4, 49.70, +73,  1, 31.1, 6.31 },
-    {  1, 38, 30.89, +73,  2, 24.0, 5.28 },
-    { 10, 18,  1.10, +73,  4, 23.9, 6.40 },
-    {  9, 37, 56.21, +73,  4, 50.2, 6.42 },
-    { 16, 56, 16.80, +73,  7, 40.1, 6.30 },
-    { 21, 59, 15.00, +73, 10, 48.0, 5.03 },
-    {  5, 18, 13.30, +73, 16,  5.2, 5.74 },
-    { 22, 12, 52.90, +73, 18, 25.9, 6.08 },
-    {  3, 35, 12.41, +73, 20, 48.8, 6.57 },
-    { 19, 15, 33.00, +73, 21, 20.2, 4.45 },
-    { 16, 14, 33.50, +73, 23, 42.0, 5.98 },
-    {  8, 39, 42.60, +73, 37, 46.9, 6.15 },
-    { 22, 35, 46.10, +73, 38, 35.2, 5.08 },
-    {  6, 37, 54.91, +73, 41, 44.2, 6.24 },
-    {  5,  4, 13.01, +73, 45, 50.0, 6.66 },
-    {  2,  3, 10.51, +73, 51,  2.2, 6.23 },
-    {  8,  0, 11.71, +73, 55,  5.2, 5.41 },
-    {  5, 12, 22.39, +73, 56, 48.1, 5.43 },
-    { 23, 39, 21.10, +74,  0, 10.1, 5.98 },
-    {  9, 19, 55.80, +74,  0, 59.0, 6.50 },
-    {  2, 13, 21.19, +74,  1, 40.1, 6.29 },
-    {  5,  4, 39.79, +74,  4,   .8, 5.96 },
-    { 18, 45, 46.70, +74,  5,  8.2, 5.27 },
-    { 14, 50, 42.31, +74,  9, 20.2, 2.08 },
-    { 23, 14, 37.30, +74, 13, 52.0, 5.84 },
-    {  5,  2, 20.09, +74, 16,  9.1, 6.06 },
-    {  1, 37, 22.51, +74, 18,  2.9, 6.58 },
-    {  9, 36,  6.79, +74, 19,  4.1, 6.46 },
-    {  3, 11, 56.30, +74, 23, 37.0, 4.87 },
-    { 14,  6, 56.40, +74, 35, 37.0, 6.45 },
-    { 12,  9, 47.30, +74, 39, 41.0, 6.35 },
-    {  8, 36, 48.70, +74, 43, 25.0, 6.31 },
-    {  0, 47, 46.10, +74, 50, 51.0, 5.41 },
-    { 20, 31, 30.41, +74, 57, 16.9, 5.20 },
-    {  0, 45, 39.00, +74, 59, 17.2, 5.66 },
-    { 21, 57, 51.00, +74, 59, 48.1, 6.35 },
-    {  5, 39, 43.70, +75,  2, 38.0, 6.17 },
-    {  9, 27, 51.60, +75,  5, 53.9, 6.29 },
-    { 12, 18, 49.90, +75,  9, 38.2, 5.38 },
-    { 17, 54, 26.59, +75, 10, 14.9, 6.36 },
-    { 16, 12, 32.21, +75, 12, 38.2, 6.39 },
-    { 23, 39, 10.39, +75, 17, 34.1, 5.95 },
-    { 17,  1, 40.20, +75, 17, 49.9, 6.21 },
-    { 23, 17, 18.89, +75, 17, 57.1, 6.38 },
-    { 22, 37, 13.01, +75, 22, 18.1, 5.79 },
-    { 23,  7, 53.90, +75, 23, 15.0, 4.41 },
-    { 18, 46, 22.20, +75, 26,  2.0, 5.35 },
-    { 12, 58, 47.30, +75, 28, 21.0, 6.01 },
-    { 23, 52, 25.10, +75, 32, 40.9, 6.39 },
-    {  6,  5,  9.29, +75, 35,  8.9, 6.40 },
-    { 14, 27, 31.51, +75, 41, 46.0, 4.25 },
-    { 10, 35,  5.50, +75, 42, 47.2, 4.84 },
-    {  3, 39, 24.79, +75, 44, 22.9, 6.27 },
-    { 16, 17, 30.31, +75, 45, 19.1, 4.95 },
-    {  8, 19, 32.21, +75, 45, 24.8, 5.54 },
-    { 18, 53, 33.19, +75, 47, 15.0, 6.22 },
-    { 16, 10, 49.51, +75, 52, 39.0, 5.48 },
-    { 20, 54, 44.30, +75, 55, 32.2, 6.05 },
-    {  4, 48, 50.30, +75, 56, 28.0, 6.06 },
-    {  2,  5, 31.20, +76,  6, 54.0, 5.22 },
-    { 22, 32, 16.20, +76, 13, 35.0, 5.68 },
-    {  1, 21, 59.11, +76, 14, 20.0, 6.38 },
-    {  5, 14, 35.59, +76, 28, 22.1, 6.37 },
-    { 19, 59, 36.60, +76, 28, 53.0, 6.20 },
-    { 22, 18, 20.40, +76, 29, 17.2, 6.66 },
-    { 13, 34, 42.79, +76, 32, 48.1, 6.57 },
-    { 19,  9,  9.79, +76, 33, 38.2, 5.13 },
-    {  4, 46,   .31, +76, 36, 40.0, 6.49 },
-    { 16,  3, 31.30, +76, 47, 37.0, 5.56 },
-    { 12,  5, 15.10, +76, 54, 20.9, 5.80 },
-    {  0, 16, 13.99, +76, 57,  2.9, 6.35 },
-    { 17, 49, 27.00, +76, 57, 46.1, 5.04 },
-    {  7,  0,  4.01, +76, 58, 39.0, 4.55 },
-    { 21, 15, 42.19, +77,  0, 43.9, 5.95 },
-    {  0, 30, 55.01, +77,  1,  9.8, 6.21 },
-    { 18, 57, 57.19, +77,  3,  2.9, 6.54 },
-    {  2,  5,  7.39, +77, 16, 53.0, 5.38 },
-    { 15, 31, 24.89, +77, 20, 57.8, 4.96 },
-    { 16, 30, 38.81, +77, 26, 48.1, 6.34 },
-    { 16, 43,  6.00, +77, 30, 51.1, 5.98 },
-    { 18, 29, 44.90, +77, 32, 48.8, 5.64 },
-    { 14,  8, 50.90, +77, 32, 51.0, 4.82 },
-    {  1, 20, 19.49, +77, 34, 14.2, 6.31 },
-    { 23, 51, 57.60, +77, 35, 57.8, 6.55 },
-    { 12, 12, 11.90, +77, 36, 59.0, 5.14 },
-    { 23, 39, 20.81, +77, 37, 57.0, 3.21 },
-    { 20,  8, 53.30, +77, 42, 41.0, 4.39 },
-    {  3, 20, 19.70, +77, 44,  4.9, 5.45 },
-    { 10, 59, 56.81, +77, 46, 12.0, 6.20 },
-    { 15, 44,  3.50, +77, 47, 39.8, 4.32 },
-    {  2,  2, 57.19, +77, 54, 59.0, 6.04 },
-    {  5, 29, 25.70, +77, 58, 39.0, 6.56 },
-    {  6, 40, 28.80, +77, 59, 44.9, 5.73 },
-    { 13, 42, 39.31, +78,  3, 51.8, 5.91 },
-    { 21,  5, 29.30, +78,  7, 35.0, 5.91 },
-    {  9, 45, 30.79, +78,  8,  4.9, 6.23 },
-    { 22, 23, 41.30, +78, 14, 35.9, 6.76 },
-    { 17, 50, 10.51, +78, 18, 24.1, 6.24 },
-    { 13, 26, 56.71, +78, 38, 38.0, 5.77 },
-    {  1, 23, 46.80, +78, 43, 32.9, 6.07 },
-    { 22, 26, 42.50, +78, 47,  8.9, 5.83 },
-    { 22, 29, 52.90, +78, 49, 27.1, 5.50 },
-    { 16, 37, 52.90, +78, 55,  5.9, 6.32 },
-    { 16, 25, 43.10, +78, 57, 50.0, 5.56 },
-    {  9, 47, 18.00, +79,  8, 12.1, 6.17 },
-    {  5, 22, 33.50, +79, 13, 52.0, 5.05 },
-    {  3,  6,  7.80, +79, 25,  7.0, 5.49 },
-    {  8,  4, 47.11, +79, 28, 46.9, 5.42 },
-    {  6, 46, 14.09, +79, 33, 52.9, 5.45 },
-    {  6, 40, 16.80, +79, 35, 57.8, 6.54 },
-    { 19, 21, 40.20, +79, 36, 10.1, 6.05 },
-    { 14, 33, 38.30, +79, 39, 37.1, 6.26 },
-    {  1, 12, 16.70, +79, 40, 26.0, 5.64 },
-    {  0,  9, 20.21, +79, 42, 52.9, 6.01 },
-    {  1, 16, 30.70, +79, 54, 36.0, 6.26 },
-    { 18, 45, 38.11, +79, 56, 33.0, 6.39 },
-    { 18,  0,  3.41, +80,  0,  2.9, 6.04 },
-    { 18,  0,  9.19, +80,  0, 15.1, 5.68 },
-    {  1,  9, 12.31, +80,  0, 42.1, 6.29 },
-    { 17, 19, 37.01, +80,  8, 11.0, 5.72 },
-    {  7, 56, 17.30, +80, 15, 56.2, 6.56 },
-    { 15, 29, 10.99, +80, 26, 55.0, 6.58 },
-    { 13, 12, 25.39, +80, 28, 17.0, 6.25 },
-    { 10, 36,  1.70, +80, 29, 39.8, 6.52 },
-    { 21, 24, 49.70, +80, 31, 28.9, 5.97 },
-    { 20, 47, 33.41, +80, 33,  7.9, 5.39 },
-    { 12, 44, 25.99, +80, 37, 16.0, 6.40 },
-    {  4, 10,  2.81, +80, 41, 55.0, 5.10 },
-    {  4, 27,  2.81, +80, 49, 27.1, 5.43 },
-    { 12,  0, 18.60, +80, 51, 11.2, 6.17 },
-    {  7, 34, 39.70, +80, 53, 48.1, 6.41 },
-    { 20, 29, 27.50, +81,  5, 29.0, 5.96 },
-    { 11, 31, 50.40, +81,  7, 37.9, 6.15 },
-    {  5,  0, 20.71, +81, 11, 38.0, 5.07 },
-    { 21, 13, 21.50, +81, 13, 50.9, 6.15 },
-    {  7, 25, 21.89, +81, 15, 27.0, 6.31 },
-    {  2,  9, 25.30, +81, 17, 44.9, 6.05 },
-    {  9, 37,  5.21, +81, 19, 35.0, 4.29 },
-    { 20, 28, 14.59, +81, 25, 22.1, 5.46 },
-    {  2, 47, 47.59, +81, 26, 53.9, 5.78 },
-    {  3, 11, 42.79, +81, 28, 14.2, 5.95 },
-    { 12, 11,   .00, +81, 42, 36.0, 6.00 },
-    { 16, 45, 58.10, +82,  2, 13.9, 4.23 },
-    {  6, 44, 30.19, +82,  6, 55.1, 6.65 },
-    {  7, 31,  4.39, +82, 24, 41.0, 4.96 },
-    {  8, 24, 32.90, +82, 25, 50.9, 6.32 },
-    {  0, 39, 47.30, +82, 29, 38.0, 6.40 },
-    { 14, 50, 20.40, +82, 30, 42.8, 5.64 },
-    { 20, 42, 35.21, +82, 31, 52.0, 5.75 },
-    { 10, 31,  4.61, +82, 33, 31.0, 5.26 },
-    { 13, 42, 23.11, +82, 45,  9.0, 5.98 },
-    { 21, 58, 12.70, +82, 52, 10.9, 6.98 },
-    { 22, 47, 28.99, +83,  9, 14.0, 4.74 },
-    { 18, 24,  9.19, +83, 10, 31.1, 6.17 },
-    { 23, 56, 27.70, +83, 11, 28.0, 6.59 },
-    {  4, 30,   .10, +83, 20, 26.2, 5.46 },
-    { 12, 49, 13.61, +83, 24, 46.1, 5.28 },
-    { 12, 49,  6.60, +83, 25,  5.2, 5.85 },
-    { 19, 15,  7.80, +83, 27, 46.1, 6.53 },
-    { 20, 29,  3.10, +83, 37, 32.2, 6.19 },
-    {  0, 54, 53.09, +83, 42, 25.9, 5.62 },
-    {  4, 28, 13.01, +83, 48, 28.1, 5.57 },
-    { 10,  8, 34.30, +83, 55,  5.9, 6.37 },
-    {  8, 16, 53.81, +84,  3, 28.1, 6.49 },
-    {  9, 15, 21.19, +84, 10, 52.0, 6.33 },
-    { 10, 29, 41.50, +84, 15,  7.9, 5.50 },
-    { 22, 54, 24.79, +84, 20, 46.0, 4.71 },
-    {  3, 32, 20.11, +84, 54, 40.0, 5.61 },
-    {  6,  1, 20.21, +85, 10, 55.9, 6.11 },
-    { 22, 51,  2.21, +85, 22, 25.0, 5.90 },
-    { 12,  4, 28.10, +85, 35, 13.9, 6.27 },
-    {  5, 43, 48.70, +85, 40,  5.2, 6.60 },
-    {  5, 31, 48.00, +85, 56, 19.0, 6.51 },
-    { 22, 13, 10.61, +86,  6, 29.2, 5.27 },
-    {  1,  8, 44.71, +86, 15, 24.8, 4.25 },
-    { 12, 16, 51.41, +86, 26, 10.0, 6.33 },
-    { 17, 32, 12.89, +86, 35, 11.0, 4.36 },
-    {  4, 10,  1.49, +86, 37, 34.0, 5.86 },
-    { 17, 30, 48.00, +86, 58,  5.2, 5.79 },
-    {  7, 40, 30.50, +87,  1, 12.0, 5.07 },
-    {  1, 16, 13.49, +87,  8, 43.1, 6.25 },
-    { 23, 27,   .79, +87, 18, 27.0, 5.58 },
-    { 12, 15, 20.30, +87, 42,   .0, 6.28 },
-    {  1, 33, 50.40, +89,  0, 56.2, 6.46 },
-    { 17, 16, 56.81, +89,  2, 16.1, 6.38 },
-    {  2, 31, 48.70, +89, 15, 51.1, 2.02 },
-};
-
diff --git a/extern/caelum/src/CaelumDefaultTypeDescriptorData.cpp b/extern/caelum/src/CaelumDefaultTypeDescriptorData.cpp
deleted file mode 100644
index d3d29e5e0b..0000000000
--- a/extern/caelum/src/CaelumDefaultTypeDescriptorData.cpp
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "CaelumPrerequisites.h"
-
-#if CAELUM_TYPE_DESCRIPTORS
-
-#include "TypeDescriptor.h"
-#include "CaelumSystem.h"
-#include "FlatCloudLayer.h"
-
-using namespace Ogre;
-
-namespace Caelum
-{
-    CaelumDefaultTypeDescriptorData::CaelumDefaultTypeDescriptorData ():
-            CaelumSystemTypeDescriptor(0),
-            PointStarfieldTypeDescriptor(0),
-            BaseSkyLightTypeDescriptor(0),
-            GroundFogTypeDescriptor(0),
-            PrecipitationTypeDescriptor(0),
-            DepthComposerTypeDescriptor(0),
-            FlatCloudLayerTypeDescriptor(0),
-            SkyDomeTypeDescriptor(0)
-    {
-        try {
-            load ();
-        } catch (...) {
-            unload ();
-            throw;
-        }
-    }
-
-    CaelumDefaultTypeDescriptorData::~CaelumDefaultTypeDescriptorData ()
-    {
-        unload ();
-    }
-
-    template<class T>
-    inline void delete_zero(T*& member) {
-        // Remember: delete 0 is a legal no-op.
-        delete member;
-        member = 0;
-    }
-
-    void CaelumDefaultTypeDescriptorData::unload ()
-    {
-        delete_zero(CaelumSystemTypeDescriptor);
-        delete_zero(PointStarfieldTypeDescriptor);
-        delete_zero(BaseSkyLightTypeDescriptor);
-        delete_zero(GroundFogTypeDescriptor);
-        delete_zero(PrecipitationTypeDescriptor);
-        delete_zero(DepthComposerTypeDescriptor);
-        delete_zero(FlatCloudLayerTypeDescriptor);
-        delete_zero(SkyDomeTypeDescriptor);
-    }
-
-    void CaelumDefaultTypeDescriptorData::load ()
-    {
-        if (!CaelumSystemTypeDescriptor)
-        {
-            std::auto_ptr<DefaultTypeDescriptor> td (new DefaultTypeDescriptor ());
-
-            // Timing settings.
-            td->add("time_scale",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, Real, Real, Real>(
-                            &Caelum::CaelumSystem::getTimeScale,
-                            &Caelum::CaelumSystem::setTimeScale));
-            td->add("julian_day",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, LongReal, LongReal, LongReal>(
-                            &Caelum::CaelumSystem::getJulianDay,
-                            &Caelum::CaelumSystem::setJulianDay));
-
-            // Latitude/longitude
-            td->add("latitude",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, Degree, Degree, const Degree>(
-                            &Caelum::CaelumSystem::getObserverLatitude,
-                            &Caelum::CaelumSystem::setObserverLatitude));
-            td->add("longitude",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, Degree, Degree, const Degree>(
-                            &Caelum::CaelumSystem::getObserverLongitude,
-                            &Caelum::CaelumSystem::setObserverLongitude));
-
-            // Fog settings.
-            td->add("global_fog_density_multiplier",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, Real, Real, Real>(
-                            &Caelum::CaelumSystem::getGlobalFogDensityMultiplier,
-                            &Caelum::CaelumSystem::setGlobalFogDensityMultiplier));
-            td->add("global_fog_colour_multiplier",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, ColourValue>(
-                            &Caelum::CaelumSystem::getGlobalFogColourMultiplier,
-                            &Caelum::CaelumSystem::setGlobalFogColourMultiplier));
-            td->add("manage_scene_fog",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, bool, bool, bool>(
-                            &Caelum::CaelumSystem::getManageSceneFog,
-                            &Caelum::CaelumSystem::setManageSceneFog));
-            td->add("scene_fog_density_multiplier",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, Real, Real, Real>(
-                            &Caelum::CaelumSystem::getSceneFogDensityMultiplier,
-                            &Caelum::CaelumSystem::setSceneFogDensityMultiplier));
-            td->add("scene_fog_colour_multiplier",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, ColourValue>(
-                            &Caelum::CaelumSystem::getSceneFogColourMultiplier,
-                            &Caelum::CaelumSystem::setSceneFogColourMultiplier));
-            td->add("ground_fog_density_multiplier",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, Real, Real, Real>(
-                            &Caelum::CaelumSystem::getGroundFogDensityMultiplier,
-                            &Caelum::CaelumSystem::setGroundFogDensityMultiplier));
-            td->add("ground_fog_colour_multiplier",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, ColourValue>(
-                            &Caelum::CaelumSystem::getGroundFogColourMultiplier,
-                            &Caelum::CaelumSystem::setGroundFogColourMultiplier));
-
-            // Lighting settings.
-            td->add("manage_ambient_light",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, bool, bool, bool>(
-                            &Caelum::CaelumSystem::getManageAmbientLight,
-                            &Caelum::CaelumSystem::setManageAmbientLight));
-            td->add("minimum_ambient_light",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, ColourValue>(
-                            &Caelum::CaelumSystem::getMinimumAmbientLight,
-                            &Caelum::CaelumSystem::setMinimumAmbientLight));
-            td->add("ensure_single_light_source",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, bool, bool, bool>(
-                            &Caelum::CaelumSystem::getEnsureSingleLightSource,
-                            &Caelum::CaelumSystem::setEnsureSingleLightSource));
-            td->add("ensure_single_shadow_source",
-                    new AccesorPropertyDescriptor<Caelum::CaelumSystem, bool, bool, bool>(
-                            &Caelum::CaelumSystem::getEnsureSingleShadowSource,
-                            &Caelum::CaelumSystem::setEnsureSingleShadowSource));
-
-            CaelumSystemTypeDescriptor = td.release ();
-        }
-
-        if (!PointStarfieldTypeDescriptor)
-        {
-            std::auto_ptr<DefaultTypeDescriptor> td (new DefaultTypeDescriptor ());
-            td->add("magnitude_scale",
-                    new AccesorPropertyDescriptor<Caelum::PointStarfield, Real, Real, Real>(
-                            &Caelum::PointStarfield::getMagnitudeScale,
-                            &Caelum::PointStarfield::setMagnitudeScale));
-            td->add("mag0_pixel_size",
-                    new AccesorPropertyDescriptor<Caelum::PointStarfield, Real, Real, Real>(
-                            &Caelum::PointStarfield::getMag0PixelSize,
-                            &Caelum::PointStarfield::setMag0PixelSize));
-            td->add("min_pixel_size",
-                    new AccesorPropertyDescriptor<Caelum::PointStarfield, Real, Real, Real>(
-                            &Caelum::PointStarfield::getMinPixelSize,
-                            &Caelum::PointStarfield::setMinPixelSize));
-            td->add("max_pixel_size",
-                    new AccesorPropertyDescriptor<Caelum::PointStarfield, Real, Real, Real>(
-                            &Caelum::PointStarfield::getMaxPixelSize,
-                            &Caelum::PointStarfield::setMaxPixelSize));
-            td->add("latitude",
-                    new AccesorPropertyDescriptor<Caelum::PointStarfield, Degree, Degree, Degree>(
-                            &Caelum::PointStarfield::getObserverLatitude,
-                            &Caelum::PointStarfield::setObserverLatitude));
-            td->add("longitude",
-                    new AccesorPropertyDescriptor<Caelum::PointStarfield, Degree, Degree, Degree>(
-                            &Caelum::PointStarfield::getObserverLongitude,
-                            &Caelum::PointStarfield::setObserverLongitude));
-            td->add("observer_position_rebuild_delta",
-                    new AccesorPropertyDescriptor<Caelum::PointStarfield, Degree, Degree, Degree>(
-                            &Caelum::PointStarfield::getObserverPositionRebuildDelta,
-                            &Caelum::PointStarfield::setObserverPositionRebuildDelta));
-            PointStarfieldTypeDescriptor = td.release ();
-        }
-
-        if (!BaseSkyLightTypeDescriptor)
-        {
-            std::auto_ptr<DefaultTypeDescriptor> td (new DefaultTypeDescriptor ());
-            td->add("ambient_multiplier",
-                    new AccesorPropertyDescriptor<Caelum::BaseSkyLight, ColourValue>(
-                            &Caelum::BaseSkyLight::getAmbientMultiplier,
-                            &Caelum::BaseSkyLight::setAmbientMultiplier));
-            td->add("specular_multiplier",
-                    new AccesorPropertyDescriptor<Caelum::BaseSkyLight, ColourValue>(
-                            &Caelum::BaseSkyLight::getSpecularMultiplier,
-                            &Caelum::BaseSkyLight::setSpecularMultiplier));
-            td->add("diffuse_multiplier",
-                    new AccesorPropertyDescriptor<Caelum::BaseSkyLight, ColourValue>(
-                            &Caelum::BaseSkyLight::getDiffuseMultiplier,
-                            &Caelum::BaseSkyLight::setDiffuseMultiplier));
-            td->add("light_colour",
-                    new AccesorPropertyDescriptor<Caelum::BaseSkyLight, ColourValue>(
-                            &Caelum::BaseSkyLight::getLightColour,
-                            &Caelum::BaseSkyLight::setLightColour));
-            td->add("body_colour",
-                    new AccesorPropertyDescriptor<Caelum::BaseSkyLight, ColourValue>(
-                            &Caelum::BaseSkyLight::getBodyColour,
-                            &Caelum::BaseSkyLight::setBodyColour));
-            td->add("auto_disable_threshold",
-                    new AccesorPropertyDescriptor<Caelum::BaseSkyLight, Real, Real, Real>(
-                            &Caelum::BaseSkyLight::getAutoDisableThreshold,
-                            &Caelum::BaseSkyLight::setAutoDisableThreshold));
-            td->add("auto_disable",
-                    new AccesorPropertyDescriptor<Caelum::BaseSkyLight, bool, bool, bool>(
-                            &Caelum::BaseSkyLight::getAutoDisable,
-                            &Caelum::BaseSkyLight::setAutoDisable));
-            BaseSkyLightTypeDescriptor = td.release ();
-        }
-
-        if (!GroundFogTypeDescriptor)
-        {
-            std::auto_ptr<DefaultTypeDescriptor> td (new DefaultTypeDescriptor ());
-            td->add("density",
-                    new AccesorPropertyDescriptor<Caelum::GroundFog, Real, Real, Real>(
-                            &Caelum::GroundFog::getDensity,
-                            &Caelum::GroundFog::setDensity));
-            td->add("vertical_decay",
-                    new AccesorPropertyDescriptor<Caelum::GroundFog, Real, Real, Real>(
-                            &Caelum::GroundFog::getVerticalDecay,
-                            &Caelum::GroundFog::setVerticalDecay));
-            td->add("ground_level",
-                    new AccesorPropertyDescriptor<Caelum::GroundFog, Real, Real, Real>(
-                            &Caelum::GroundFog::getGroundLevel,
-                            &Caelum::GroundFog::setGroundLevel));
-            td->add("colour",
-                    new AccesorPropertyDescriptor<Caelum::GroundFog, ColourValue>(
-                            &Caelum::GroundFog::getColour,
-                            &Caelum::GroundFog::setColour));
-            GroundFogTypeDescriptor = td.release ();
-        }
-
-        if (!DepthComposerTypeDescriptor)
-        {
-            std::auto_ptr<DefaultTypeDescriptor> td (new DefaultTypeDescriptor ());
-            td->add("debug_depth_render",
-                    new AccesorPropertyDescriptor<Caelum::DepthComposer, bool, bool, bool>(
-                            &Caelum::DepthComposer::getDebugDepthRender,
-                            &Caelum::DepthComposer::setDebugDepthRender));
-
-            // Legacy haze
-            td->add("haze_enabled",
-                    new AccesorPropertyDescriptor<Caelum::DepthComposer, bool, bool, bool>(
-                            &Caelum::DepthComposer::getSkyDomeHazeEnabled,
-                            &Caelum::DepthComposer::setSkyDomeHazeEnabled));
-            td->add("haze_colour",
-                    new AccesorPropertyDescriptor<Caelum::DepthComposer, ColourValue>(
-                            &Caelum::DepthComposer::getHazeColour,
-                            &Caelum::DepthComposer::setHazeColour));
-            td->add("haze_sun_direction",
-                    new AccesorPropertyDescriptor<Caelum::DepthComposer, Vector3>(
-                            &Caelum::DepthComposer::getSunDirection,
-                            &Caelum::DepthComposer::setSunDirection));
-
-            // Ground fog
-            td->add("ground_fog_enabled",
-                    new AccesorPropertyDescriptor<Caelum::DepthComposer, bool, bool, bool>(
-                            &Caelum::DepthComposer::getGroundFogEnabled,
-                            &Caelum::DepthComposer::setGroundFogEnabled));
-            td->add("ground_fog_density",
-                    new AccesorPropertyDescriptor<Caelum::DepthComposer, Real, Real, Real>(
-                            &Caelum::DepthComposer::getGroundFogDensity,
-                            &Caelum::DepthComposer::setGroundFogDensity));
-            td->add("ground_fog_vertical_decay",
-                    new AccesorPropertyDescriptor<Caelum::DepthComposer, Real, Real, Real>(
-                            &Caelum::DepthComposer::getGroundFogVerticalDecay,
-                            &Caelum::DepthComposer::setGroundFogVerticalDecay));
-            td->add("ground_fog_base_level",
-                    new AccesorPropertyDescriptor<Caelum::DepthComposer, Real, Real, Real>(
-                            &Caelum::DepthComposer::getGroundFogBaseLevel,
-                            &Caelum::DepthComposer::setGroundFogBaseLevel));
-            td->add("ground_fog_colour",
-                    new AccesorPropertyDescriptor<Caelum::DepthComposer, ColourValue>(
-                            &Caelum::DepthComposer::getGroundFogColour,
-                            &Caelum::DepthComposer::setGroundFogColour));
-
-            DepthComposerTypeDescriptor = td.release ();
-        }
-
-        if (!PrecipitationTypeDescriptor)
-        {
-            std::auto_ptr<DefaultTypeDescriptor> td (new DefaultTypeDescriptor ());
-
-            td->add("texture",
-                    new AccesorPropertyDescriptor<Caelum::PrecipitationController, String>(
-                            &Caelum::PrecipitationController::getTextureName,
-                            &Caelum::PrecipitationController::setTextureName));
-            td->add("precipitation_colour",
-                    new AccesorPropertyDescriptor<Caelum::PrecipitationController, ColourValue>(
-                            &Caelum::PrecipitationController::getColour,
-                            &Caelum::PrecipitationController::setColour));
-            td->add("falling_speed",
-                    new AccesorPropertyDescriptor<Caelum::PrecipitationController, Real, Real, Real>(
-                            &Caelum::PrecipitationController::getSpeed,
-                            &Caelum::PrecipitationController::setSpeed));
-            td->add("wind_speed",
-                    new AccesorPropertyDescriptor<Caelum::PrecipitationController, Vector3>(
-                            &Caelum::PrecipitationController::getWindSpeed,
-                            &Caelum::PrecipitationController::setWindSpeed));
-            td->add("camera_speed_scale",
-                    new AccesorPropertyDescriptor<Caelum::PrecipitationController, Vector3>(
-                            &Caelum::PrecipitationController::getCameraSpeedScale,
-                            &Caelum::PrecipitationController::setCameraSpeedScale));
-            td->add("intensity",
-                    new AccesorPropertyDescriptor<Caelum::PrecipitationController, Real, Real, Real>(
-                            &Caelum::PrecipitationController::getIntensity,
-                            &Caelum::PrecipitationController::setIntensity));
-            td->add("auto_disable_intensity",
-                    new AccesorPropertyDescriptor<Caelum::PrecipitationController, Real, Real, Real>(
-                            &Caelum::PrecipitationController::getAutoDisableThreshold,
-                            &Caelum::PrecipitationController::setAutoDisableThreshold));
-            td->add("falling_direction",
-                    new AccesorPropertyDescriptor<Caelum::PrecipitationController, Vector3>(
-                            &Caelum::PrecipitationController::getFallingDirection,
-                            &Caelum::PrecipitationController::setFallingDirection));
-
-            PrecipitationTypeDescriptor = td.release ();
-        }
-
-        if (!FlatCloudLayerTypeDescriptor)
-        {
-            std::auto_ptr<DefaultTypeDescriptor> td (new DefaultTypeDescriptor ());
-
-            // Height.
-            td->add("height",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Real, Real, Real>(
-                            &Caelum::FlatCloudLayer::getHeight,
-                            &Caelum::FlatCloudLayer::setHeight));
-
-            // Coverage parameters.
-            td->add("coverage",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Real, Real, Real>(
-                            &Caelum::FlatCloudLayer::getCloudCover,
-                            &Caelum::FlatCloudLayer::setCloudCover));
-            td->add("cloud_cover_visibility_threshold",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Real, Real, Real>(
-                            &Caelum::FlatCloudLayer::getCloudCoverVisibilityThreshold,
-                            &Caelum::FlatCloudLayer::setCloudCoverVisibilityThreshold));
-            td->add("cloud_cover_lookup",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, String>(
-                            &Caelum::FlatCloudLayer::getCloudCoverLookupFileName,
-                            &Caelum::FlatCloudLayer::setCloudCoverLookup));
-
-            // Overwritten by CaelumSystem; included for completeness.
-            td->add("sun_direction",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Vector3>(
-                            &Caelum::FlatCloudLayer::getSunDirection,
-                            &Caelum::FlatCloudLayer::setSunDirection));
-            td->add("sun_light_colour",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, ColourValue>(
-                            &Caelum::FlatCloudLayer::getSunLightColour,
-                            &Caelum::FlatCloudLayer::setSunLightColour));
-            td->add("sun_sphere_colour",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, ColourValue>(
-                            &Caelum::FlatCloudLayer::getSunSphereColour,
-                            &Caelum::FlatCloudLayer::setSunSphereColour));
-            td->add("fog_colour",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, ColourValue>(
-                            &Caelum::FlatCloudLayer::getFogColour,
-                            &Caelum::FlatCloudLayer::setFogColour));
-
-            // Moving noise textures.
-            td->add("cloud_speed",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Vector2>(
-                            &Caelum::FlatCloudLayer::getCloudSpeed,
-                            &Caelum::FlatCloudLayer::setCloudSpeed)); 
-
-            // Blending time between noise textures.
-            td->add("blend_time",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Real, Real, Real>(
-                            &Caelum::FlatCloudLayer::getCloudBlendTime,
-                            &Caelum::FlatCloudLayer::setCloudBlendTime));
-
-            // Mesh properties
-            td->add("mesh_width",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Real, Real, Real>(
-                            &Caelum::FlatCloudLayer::getMeshWidth,
-                            &Caelum::FlatCloudLayer::setMeshWidth));
-            td->add("mesh_height",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Real, Real, Real>(
-                            &Caelum::FlatCloudLayer::getMeshHeight,
-                            &Caelum::FlatCloudLayer::setMeshHeight));
-            td->add("mesh_width_segments",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, int, int, int>(
-                            &Caelum::FlatCloudLayer::getMeshWidthSegments,
-                            &Caelum::FlatCloudLayer::setMeshWidthSegments));
-            td->add("mesh_height_segments",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, int, int, int>(
-                            &Caelum::FlatCloudLayer::getMeshHeightSegments,
-                            &Caelum::FlatCloudLayer::setMeshHeightSegments));
-
-            // Misc hacks
-            td->add("cloud_uv_factor",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Real, Real, Real>(
-                            &Caelum::FlatCloudLayer::getCloudUVFactor,
-                            &Caelum::FlatCloudLayer::setCloudUVFactor));
-            td->add("height_red_factor",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Real, Real, Real>(
-                            &Caelum::FlatCloudLayer::getHeightRedFactor,
-                            &Caelum::FlatCloudLayer::setHeightRedFactor));
-
-            // Fading
-            td->add("near_fade_dist",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Real, Real, Real>(
-                            &Caelum::FlatCloudLayer::getNearFadeDist,
-                            &Caelum::FlatCloudLayer::setNearFadeDist));
-            td->add("far_fade_dist",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Real, Real, Real>(
-                            &Caelum::FlatCloudLayer::getFarFadeDist,
-                            &Caelum::FlatCloudLayer::setFarFadeDist));
-            td->add("fade_dist_measurement_vector",
-                    new AccesorPropertyDescriptor<Caelum::FlatCloudLayer, Vector3>(
-                            &Caelum::FlatCloudLayer::getFadeDistMeasurementVector,
-                            &Caelum::FlatCloudLayer::setFadeDistMeasurementVector));
-
-            FlatCloudLayerTypeDescriptor = td.release ();
-        }
-
-        if (!SkyDomeTypeDescriptor)
-        {
-            std::auto_ptr<DefaultTypeDescriptor> td (new DefaultTypeDescriptor ());
-
-            // SkyDome is slightly special because most properties are write-only.
-
-            // Reset by CaelumSystem every frame anyway
-            td->add("sun_direction",
-                    new AccesorPropertyDescriptor<Caelum::SkyDome, Ogre::Vector3>(
-                            0, &Caelum::SkyDome::setSunDirection));
-            td->add("haze_colour",
-                    new AccesorPropertyDescriptor<Caelum::SkyDome, Ogre::ColourValue>(
-                            0, &Caelum::SkyDome::setHazeColour));
-
-            // Different files not supported anyway
-            td->add("sky_gradients_image",
-                    new AccesorPropertyDescriptor<Caelum::SkyDome, Ogre::String>(
-                            0, &Caelum::SkyDome::setSkyGradientsImage));
-            td->add("atmosphere_depth_image",
-                    new AccesorPropertyDescriptor<Caelum::SkyDome, Ogre::String>(
-                            0, &Caelum::SkyDome::setAtmosphereDepthImage));
-
-            // This does actually make sense.
-            td->add("haze_enabled",
-                    new AccesorPropertyDescriptor<Caelum::SkyDome, bool, bool, bool>(
-                            &Caelum::SkyDome::getHazeEnabled,
-                            &Caelum::SkyDome::setHazeEnabled));
-
-            SkyDomeTypeDescriptor = td.release ();
-        }
-    }
-}
-
-#endif // CAELUM_TYPE_DESCRIPTORS
diff --git a/extern/caelum/src/CaelumPlugin.cpp b/extern/caelum/src/CaelumPlugin.cpp
deleted file mode 100644
index 288ad9220a..0000000000
--- a/extern/caelum/src/CaelumPlugin.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "CaelumPlugin.h"
-
-template<> Caelum::CaelumPlugin* Ogre::Singleton<Caelum::CaelumPlugin>::ms_Singleton = 0;
-
-namespace Caelum
-{
-	CaelumPlugin* CaelumPlugin::getSingletonPtr () {
-        return ms_Singleton;
-    }
-
-    CaelumPlugin& CaelumPlugin::getSingleton () {  
-        assert (ms_Singleton);
-        return *ms_Singleton;  
-    }
-
-    extern "C" void CAELUM_EXPORT dllStartPlugin () {
-        assert (CaelumPlugin::getSingletonPtr () == 0);
-        CaelumPlugin* plugin = new CaelumPlugin();
-        assert (CaelumPlugin::getSingletonPtr () == plugin);
-        Ogre::Root::getSingleton ().installPlugin (CaelumPlugin::getSingletonPtr ());
-    }
-
-    extern "C" void CAELUM_EXPORT dllStopPlugin () {
-        assert (CaelumPlugin::getSingletonPtr () != 0);
-        Ogre::Root::getSingleton ().uninstallPlugin (CaelumPlugin::getSingletonPtr ());
-        delete CaelumPlugin::getSingletonPtr ();
-        assert (CaelumPlugin::getSingletonPtr () == 0);
-    }
-
-#if CAELUM_SCRIPT_SUPPORT
-    CaelumPlugin::CaelumPlugin(): mScriptTranslatorManager(&mTypeDescriptorData)
-#else
-    CaelumPlugin::CaelumPlugin()
-#endif
-    {
-        mIsInstalled = false;
-    }
-
-    CaelumPlugin::~CaelumPlugin() {
-    }
-
-    const Ogre::String CaelumPlugin::CAELUM_PLUGIN_NAME = "Caelum";
-
-    const Ogre::String& CaelumPlugin::getName () const {
-        return CAELUM_PLUGIN_NAME;
-    }
-
-    void CaelumPlugin::install ()
-    {
-        assert(!mIsInstalled && "Already installed");
-
-        Ogre::LogManager::getSingleton ().logMessage("Caelum plugin version " + 
-                Ogre::StringConverter::toString (CAELUM_VERSION_MAIN) + "." +
-                Ogre::StringConverter::toString (CAELUM_VERSION_SEC) + "." +
-                Ogre::StringConverter::toString (CAELUM_VERSION_TER) + " "
-                "installed");
-
-#if CAELUM_SCRIPT_SUPPORT
-        Ogre::ScriptCompilerManager::getSingleton ().addTranslatorManager (
-                getScriptTranslatorManager ());
-        Ogre::ResourceGroupManager::getSingleton()._registerResourceManager (
-                getPropScriptResourceManager ()->getResourceType (),
-                getPropScriptResourceManager ());
-
-        getScriptTranslatorManager()->_setPropScriptResourceManager (
-                &mPropScriptResourceManager);
-#endif // CAELUM_SCRIPT_SUPPORT
-
-        mIsInstalled = true;
-    }
-
-    void CaelumPlugin::initialise () {
-    }
-
-    void CaelumPlugin::shutdown () {
-    }
-
-    void CaelumPlugin::uninstall ()
-    {
-        assert(mIsInstalled && "Not installed");
-
-#if CAELUM_SCRIPT_SUPPORT
-        getScriptTranslatorManager()->_setPropScriptResourceManager (0);
-
-        Ogre::ResourceGroupManager::getSingleton ()._unregisterResourceManager (
-                getPropScriptResourceManager ()->getResourceType ());
-        Ogre::ScriptCompilerManager::getSingleton ().removeTranslatorManager (
-                getScriptTranslatorManager ());
-#endif // CAELUM_SCRIPT_SUPPORT
-
-        Ogre::LogManager::getSingleton ().logMessage("Caelum plugin uninstalled");
-
-        mIsInstalled = false;
-    }
-
-#if CAELUM_SCRIPT_SUPPORT
-    void CaelumPlugin::loadCaelumSystemFromScript (
-            CaelumSystem* sys,
-            const Ogre::String& objectName,
-            const Ogre::String& groupName)
-    {
-        assert (sys);
-        assert (this->isInstalled () && "Must install CaelumPlugin before loading scripts");
-
-        // Fetch raw resource ptr. Attempt to support explicit resource groups currently in Ogre trunk.
-#if OGRE_VERSION >= 0x00010700
-        Ogre::ResourcePtr res = getPropScriptResourceManager ()->getByName (objectName, groupName);
-#else
-        Ogre::ResourcePtr res = getPropScriptResourceManager ()->getByName (objectName);
-#endif
-
-        // Check a PropScriptResource was found.
-        PropScriptResource* propRes = static_cast<PropScriptResource*> (res.get ());
-        if (!propRes) {
-            OGRE_EXCEPT (Ogre::Exception::ERR_ITEM_NOT_FOUND,
-                    "Could not find caelum_sky_system " + objectName,
-                    "CaelumPlugin::loadCaelumSystemFromScript");
-        }
-
-        // Fetch the resource stream. Look in the actual group of the resource!
-        const Ogre::String& scriptFileName = propRes->getOrigin();
-        const Ogre::String& scriptFileGroup = propRes->getGroup();
-        Ogre::DataStreamPtr streamPtr = Ogre::ResourceGroupManager::getSingleton ().openResource (
-                scriptFileName, scriptFileGroup, false);
-
-        // Feed it into the compiler.
-        this->getScriptTranslatorManager()->getCaelumSystemTranslator()->setTranslationTarget (sys, objectName);
-        Ogre::ScriptCompilerManager::getSingleton ().parseScript (streamPtr, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
-        bool found = this->getScriptTranslatorManager()->getCaelumSystemTranslator()->foundTranslationTarget ();
-
-        // This shouldn't normally happen.
-        if (!found) {
-            OGRE_EXCEPT (Ogre::Exception::ERR_ITEM_NOT_FOUND,
-                    "Could not find caelum_sky_system " + objectName + " in file " + scriptFileName + " on reparsing. "
-                    "Perhaps information in PropScriptResourceManager is out of date?",
-                    "CaelumPlugin::loadCaelumSystemFromScript");
-        }
-        this->getScriptTranslatorManager()->getCaelumSystemTranslator()->clearTranslationTarget ();
-    }
-#endif // CAELUM_SCRIPT_SUPPORT
-}
diff --git a/extern/caelum/src/CaelumPrecompiled.cpp b/extern/caelum/src/CaelumPrecompiled.cpp
deleted file mode 100644
index 9875371a23..0000000000
--- a/extern/caelum/src/CaelumPrecompiled.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
diff --git a/extern/caelum/src/CaelumScriptTranslator.cpp b/extern/caelum/src/CaelumScriptTranslator.cpp
deleted file mode 100644
index f4aa743d36..0000000000
--- a/extern/caelum/src/CaelumScriptTranslator.cpp
+++ /dev/null
@@ -1,643 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "CaelumPrerequisites.h"
-
-#if CAELUM_SCRIPT_SUPPORT
-
-#include "CaelumScriptTranslator.h"
-#include "CaelumSystem.h"
-#include "CaelumExceptions.h"
-
-using namespace Ogre;
-
-namespace Caelum
-{
-    PropScriptResource::PropScriptResource
-    (
-        Ogre::ResourceManager* creator, const Ogre::String& name, Ogre::ResourceHandle handle,
-        const Ogre::String& group, bool isManual, Ogre::ManualResourceLoader* loader
-    ):
-        Ogre::Resource (creator, name, handle, group, isManual, loader)
-    {
-        //Ogre::LogManager::getSingleton().logMessage(
-        //        "PropScriptResource::PropScriptResource");
-    }
-
-    PropScriptResource::~PropScriptResource() {
-        //Ogre::LogManager::getSingleton().logMessage(
-        //        "PropScriptResource::~PropScriptResource");
-    }
-
-    PropScriptResourceManager::PropScriptResourceManager() {
-        mLoadOrder = 1000;
-        mResourceType = "PropertyScript";
-    }
-
-    PropScriptResource* PropScriptResourceManager::createImpl(
-                const String& name, ResourceHandle handle, const String& group,
-                bool isManual, ManualResourceLoader* loader, const NameValuePairList* createParams)
-    {
-        //Ogre::LogManager::getSingleton().logMessage(
-        //        "PropScriptResourceManager::createImpl");
-        return new PropScriptResource (this, name, handle, group, isManual, loader);
-    }
-
-    TypeDescriptorScriptTranslator::TypeDescriptorScriptTranslator (TypeDescriptor* typeDescriptor):
-            mTypeDescriptor(typeDescriptor)
-    {
-    }
-
-    bool TypeDescriptorScriptTranslator::getPropValueOrAddError (
-            ScriptCompiler* compiler,
-            PropertyAbstractNode* prop,
-            bool& value)
-    {
-        if (prop->values.empty ()) {
-            compiler->addError (ScriptCompiler::CE_STRINGEXPECTED, prop->file, prop->line);
-            return false;
-        }
-        if (prop->values.size () > 1) {
-            compiler->addError (ScriptCompiler::CE_FEWERPARAMETERSEXPECTED, prop->file, prop->line,
-                    prop->name + " must have at most 1 argument");
-            return false;
-        } 
-        if (!Ogre::ScriptTranslator::getBoolean(prop->values.front(), &value)) {
-            compiler->addError (ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
-                        prop->values.front()->getValue() + " is not a valid number");
-            return false;
-        }
-        return true;
-    }
-
-    bool TypeDescriptorScriptTranslator::getPropValueOrAddError (
-            ScriptCompiler* compiler,
-            PropertyAbstractNode* prop,
-            ColourValue& value)
-    {
-        if (prop->values.empty ()) {
-            compiler->addError (ScriptCompiler::CE_STRINGEXPECTED, prop->file, prop->line);
-            return false;
-        }
-        if (prop->values.size () > 4) {
-            compiler->addError (ScriptCompiler::CE_FEWERPARAMETERSEXPECTED, prop->file, prop->line,
-                    prop->name + " must have at most 4 arguments");
-            return false;
-        }
-        if (prop->values.size () < 3) {
-            compiler->addError (ScriptCompiler::CE_FEWERPARAMETERSEXPECTED, prop->file, prop->line,
-                    prop->name + " must have at least 3 arguments");
-        }
-        if (!getColour(prop->values.begin(), prop->values.end(), &value)) {
-            compiler->addError (ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
-                    prop->name + " requires a colour argument");
-        }
-        return true;
-    }
-
-    bool TypeDescriptorScriptTranslator::getPropValueOrAddError (
-            ScriptCompiler* compiler,
-            PropertyAbstractNode* prop,
-            float& value)
-    {
-        if (prop->values.empty ()) {
-            compiler->addError (ScriptCompiler::CE_STRINGEXPECTED, prop->file, prop->line);
-            return false;
-        }
-        if (prop->values.size () > 1) {
-            compiler->addError (ScriptCompiler::CE_FEWERPARAMETERSEXPECTED, prop->file, prop->line,
-                    prop->name + " must have at most 1 argument");
-            return false;
-        } 
-        if (!Ogre::ScriptTranslator::getFloat(prop->values.front(), &value)) {
-            compiler->addError (ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
-                        prop->values.front()->getValue() + " is not a valid number");
-            return false;
-        }
-        return true;
-    }
-
-    bool TypeDescriptorScriptTranslator::getPropValueOrAddError (
-            ScriptCompiler* compiler,
-            PropertyAbstractNode* prop,
-            int& value)
-    {
-        if (prop->values.empty ()) {
-            compiler->addError (ScriptCompiler::CE_STRINGEXPECTED, prop->file, prop->line);
-            return false;
-        }
-        if (prop->values.size () > 1) {
-            compiler->addError (ScriptCompiler::CE_FEWERPARAMETERSEXPECTED, prop->file, prop->line,
-                    prop->name + " must have at most 1 argument");
-            return false;
-        } 
-        if (!Ogre::ScriptTranslator::getInt(prop->values.front(), &value)) {
-            compiler->addError (ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
-                        prop->values.front()->getValue() + " is not a valid integer");
-            return false;
-        }
-        return true;
-    }
-
-    bool TypeDescriptorScriptTranslator::getPropValueOrAddError (
-            ScriptCompiler* compiler,
-            PropertyAbstractNode* prop,
-            double& value)
-    {
-        if (prop->values.empty ()) {
-            compiler->addError (ScriptCompiler::CE_STRINGEXPECTED, prop->file, prop->line);
-            return false;
-        }
-        if (prop->values.size () > 1) {
-            compiler->addError (ScriptCompiler::CE_FEWERPARAMETERSEXPECTED, prop->file, prop->line,
-                    prop->name + " must have at most 1 argument");
-            return false;
-        } 
-        // We do need a string stream here for the extra precision.
-        std::stringstream strStream (std::string(prop->values.front()->getValue()));
-        strStream >> value;
-        if (strStream.fail()) {
-            compiler->addError (ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
-                    prop->values.front()->getValue() + " is not a valid number");
-            return false;
-        }
-        return true;
-    }
-
-    bool TypeDescriptorScriptTranslator::getPropValueOrAddError (
-            ScriptCompiler* compiler,
-            PropertyAbstractNode* prop,
-            Ogre::Degree& value)
-    {
-        if (prop->values.size () == 0) {
-            compiler->addError (ScriptCompiler::CE_STRINGEXPECTED, prop->file, prop->line);
-            return false;
-        }
-        if (prop->values.size () > 3) {
-            compiler->addError (ScriptCompiler::CE_FEWERPARAMETERSEXPECTED, prop->file, prop->line,
-                    prop->name + " must have at most 3 arguments");
-            return false;
-        } 
-        // Allow 3 components.
-        float degMinSec[3] = { 0, 0, 0 };
-        int k = 0;
-        for (AbstractNodeList::const_iterator it = prop->values.begin(), endIt = prop->values.end(); it != endIt; ++it, ++k) {
-            if (!Ogre::ScriptTranslator::getFloat(*it, &degMinSec[k])) {
-                compiler->addError (ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
-                        (*it)->getValue () + " is not a valid number");
-                return false;
-            }
-        }
-        value = Ogre::Degree(degMinSec[0] + degMinSec[1] / 60.0 + degMinSec[2] / 3600);
-        return true;
-    }
-
-    bool TypeDescriptorScriptTranslator::getPropValueOrAddError (
-            ScriptCompiler* compiler,
-            PropertyAbstractNode* prop,
-            Ogre::String& value)
-    {
-        if (prop->values.size () == 0) {
-            compiler->addError (ScriptCompiler::CE_STRINGEXPECTED, prop->file, prop->line);
-            return false;
-        }
-        if (prop->values.size () > 1) {
-            compiler->addError (ScriptCompiler::CE_FEWERPARAMETERSEXPECTED, prop->file, prop->line,
-                    prop->name + " must have at most 1 arguments");
-            return false;
-        } 
-        if (!Ogre::ScriptTranslator::getString(prop->values.front(), &value)) {
-            compiler->addError (ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,
-                        prop->values.front()->getValue() + " is not a valid string");
-            return false;
-        }
-        return true;
-    }
-
-    bool TypeDescriptorScriptTranslator::getPropValueOrAddError (
-            ScriptCompiler* compiler,
-            PropertyAbstractNode* prop,
-            Ogre::Vector3& value)
-    {
-        if (prop->values.size () == 0) {
-            compiler->addError (ScriptCompiler::CE_STRINGEXPECTED, prop->file, prop->line);
-            return false;
-        }
-        if (prop->values.size () > 3) {
-            compiler->addError (ScriptCompiler::CE_FEWERPARAMETERSEXPECTED, prop->file, prop->line,
-                    prop->name + " must have at most 3 arguments");
-            return false;
-        } 
-        float floats[3];
-        if (!Ogre::ScriptTranslator::getFloats(prop->values.begin(), prop->values.end(), floats, 3)) {
-            compiler->addError (ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,         
-                    "incorrect vector parameters.");
-            return false;
-        }
-        value.x = floats[0];
-        value.y = floats[1];
-        value.z = floats[2];
-        return true;
-    }
- 
-    bool TypeDescriptorScriptTranslator::getPropValueOrAddError (
-            ScriptCompiler* compiler,
-            PropertyAbstractNode* prop,
-            Ogre::Vector2& value)
-    {
-        if (prop->values.size () == 0) {
-            compiler->addError (ScriptCompiler::CE_STRINGEXPECTED, prop->file, prop->line);
-            return false;
-        }
-        if (prop->values.size () > 2) {
-            compiler->addError (ScriptCompiler::CE_FEWERPARAMETERSEXPECTED, prop->file, prop->line,
-                    prop->name + " must have at most 3 arguments");
-            return false;
-        } 
-        float floats[2];
-        if (!Ogre::ScriptTranslator::getFloats(prop->values.begin(), prop->values.end(), floats, 2)) {
-            compiler->addError (ScriptCompiler::CE_INVALIDPARAMETERS, prop->file, prop->line,         
-                    "incorrect vector parameters.");
-            return false;
-        }
-        value.x = floats[0];
-        value.y = floats[1];
-        return true;
-    }
-
-    template<class T>
-    static bool tryHandlePropertyType (
-            ScriptCompiler* compiler, PropertyAbstractNode* propNode,
-            void* targetObject, const ValuePropertyDescriptor* propDesc)
-    {
-        if (propDesc->getValueTypeId () == typeid(T)) {
-            T val;
-            if (TypeDescriptorScriptTranslator::getPropValueOrAddError (compiler, propNode, val)) {
-                propDesc->setValue (targetObject, Ogre::Any(val));
-            }
-            return true;
-        }
-        return false;
-    }
-
-    void TypeDescriptorScriptTranslator::translateProperty (
-            ScriptCompiler* compiler,
-            PropertyAbstractNode* prop,
-            void* targetObject,
-            const TypeDescriptor* typeDescriptor)
-    {
-        const ValuePropertyDescriptor* propDesc = typeDescriptor->getPropertyDescriptor (prop->name);
-        if (!propDesc) {
-            compiler->addError (ScriptCompiler::CE_UNEXPECTEDTOKEN, prop->file, prop->line, 
-                    "property \"" + prop->name + "\" not recognized; missing from type descriptor.");
-            return;
-        }
-        if (!propDesc->canSetValue ()) {
-            compiler->addError (ScriptCompiler::CE_UNEXPECTEDTOKEN, prop->file, prop->line, 
-                    "property \"" + prop->name + "\" is read-only and can't be set from a script.");
-            return;
-        }
-
-        //LogManager::getSingleton ().logMessage ("TypeDescriptorScriptTranslator::translateProperty"
-        //            " name '" + prop->name + "'");
-
-        bool handled = false
-                || tryHandlePropertyType<int> (compiler, prop, targetObject, propDesc)
-                || tryHandlePropertyType<float> (compiler, prop, targetObject, propDesc)
-                || tryHandlePropertyType<double> (compiler, prop, targetObject, propDesc)
-                || tryHandlePropertyType<bool> (compiler, prop, targetObject, propDesc)
-                || tryHandlePropertyType<Ogre::Degree> (compiler, prop, targetObject, propDesc)
-                || tryHandlePropertyType<Ogre::String> (compiler, prop, targetObject, propDesc)
-                || tryHandlePropertyType<Ogre::Vector3> (compiler, prop, targetObject, propDesc)
-                || tryHandlePropertyType<Ogre::Vector2> (compiler, prop, targetObject, propDesc)
-                || tryHandlePropertyType<Ogre::ColourValue> (compiler, prop, targetObject, propDesc);
-
-        if (!handled) {
-            compiler->addError (ScriptCompiler::CE_UNEXPECTEDTOKEN, prop->file, prop->line, 
-                    "property \"" + prop->name + "\" is found in type descriptor but has "
-                    "unsupported type. Mangled typeid is '" + propDesc->getValueTypeId().name() + "'");
-        }
-    }
-
-    void TypeDescriptorScriptTranslator::translate (ScriptCompiler* compiler, const AbstractNodePtr& node)
-    {
-        //LogManager::getSingleton ().logMessage ("TypeDescriptorScriptTranslator::translate begin");
-
-        // Check type descriptor was set.
-        assert (getTypeDescriptor () && "Type descriptor must be set before we can translate.");
-
-        // Fetch target object.
-		ObjectAbstractNode *objNode = reinterpret_cast<ObjectAbstractNode*>(node.get());
-        assert (!objNode->context.isEmpty ());
-        void* targetObject = any_cast<void*> (objNode->context);
-        assert (targetObject);
-
-		for (AbstractNodeList::iterator i = objNode->children.begin(); i != objNode->children.end(); ++i)
-		{
-			if ((*i)->type == ANT_PROPERTY)
-            {
-				PropertyAbstractNode *prop = reinterpret_cast<PropertyAbstractNode*>((*i).get());
-
-                translateProperty (compiler, prop, targetObject, getTypeDescriptor());
-			}
-			else if((*i)->type == ANT_OBJECT)
-			{
-                compiler->addError (ScriptCompiler::CE_INVALIDPARAMETERS, (*i)->file, (*i)->line);
-            }
-        }
-
-        //LogManager::getSingleton ().logMessage ("TypeDescriptorScriptTranslator::translate end");
-    }
-
-    CaelumSystemScriptTranslator::CaelumSystemScriptTranslator ():
-            mResourceManager(false),
-            mTranslationTarget(0),
-            mTranslationTargetFound(false),
-            mTypeDescriptor(0)
-    {
-    }
-
-    void CaelumSystemScriptTranslator::setTranslationTarget (CaelumSystem* target, const Ogre::String& name)
-    {
-        assert (target != 0);
-        this->mTranslationTarget = target;
-        this->mTranslationTargetName = name;
-        this->mTranslationTargetFound = false;
-    }
-
-    void CaelumSystemScriptTranslator::clearTranslationTarget () {
-        this->mTranslationTarget = 0;
-        this->mTranslationTargetName.clear();
-        this->mTranslationTargetFound = false;
-    }
-
-    void CaelumSystemScriptTranslator::translate (ScriptCompiler* compiler, const AbstractNodePtr& node)
-    {
-        //LogManager::getSingleton ().logMessage ("CaelumSystemScriptTranslator::translate begin");
-
-		ObjectAbstractNode *objNode = reinterpret_cast<ObjectAbstractNode*>(node.get());
-
-        CaelumSystem* sys = 0;
-
-        // Check for a translation target.
-        if (this->getTranslationTarget ()) {
-            sys = this->getTranslationTarget ();
-
-            // Check for a name match.
-            if (this->getTranslationTargetName () != objNode->name) {
-                //LogManager::getSingleton ().logMessage (
-                //        "Caelum: Skipped " + objNode->cls + " name " + objNode->name + " while loading");
-                return;
-            }
-            
-            // Clear the target; this ensure that properties which are not
-            // mentioned are set to their default values.
-            // We only do this after we found a target; this ensure that if
-            // the target is not found it's not modified either.
-            sys->clear();
-
-            //LogManager::getSingleton ().logMessage (
-            //        "Caelum: Found " + objNode->cls + " name " + objNode->name + "; filling properties.");
-            mTranslationTargetFound = true;
-        } else if (this->getResourceManager ()) {
-            // If we don't have a target but have a resource manager then create a resource.
-            //LogManager::getSingleton ().logMessage (
-            //        "Caelum: Saved " + objNode->cls + " name " + objNode->name + " as a resource");
-            PropScriptResourceManager* mgr = this->getResourceManager ();
-            ResourcePtr resource = mgr->create (objNode->name, compiler->getResourceGroup());
-            resource->_notifyOrigin (objNode->file);
-            return;
-        }
-
-        objNode->context = sys;
-
-		for (AbstractNodeList::iterator i = objNode->children.begin(); i != objNode->children.end(); ++i)
-		{
-			if ((*i)->type == ANT_PROPERTY)
-            {
-				PropertyAbstractNode *prop = reinterpret_cast<PropertyAbstractNode*>((*i).get());
-
-                // Properties implemented through type descriptor.
-                TypeDescriptorScriptTranslator::translateProperty(
-                        compiler, prop,
-                        static_cast<void*>(sys),
-                        getTypeDescriptor ());
-			}
-			else if((*i)->type == ANT_OBJECT)
-			{
-				ObjectAbstractNode *childObjNode = reinterpret_cast<ObjectAbstractNode*>((*i).get());
-
-                //LogManager::getSingleton ().logMessage ("CaelumSystemScriptTranslator::translate child object"
-                //        " value '" + childObjNode->getValue () + "'"
-                //        " name '" + childObjNode->name + "'"
-                //        " cls '" + childObjNode->cls + "'"
-                //        " base '" + childObjNode->base + "'");
-                
-                // Only allow declarations with one class token; like "moon { }"
-#if OGRE_VERSION < 0x010700
-                if (childObjNode->name.empty () == false || childObjNode->base.empty () == false) {
-#else
-                if (childObjNode->name.empty () == false || childObjNode->bases.size () != 0) {
-#endif
-                    compiler->addError (
-                            ScriptCompiler::CE_FEWERPARAMETERSEXPECTED,
-                            childObjNode->file, childObjNode->line,
-                            "caelum_sky_system components can't have names or bases");
-                    continue;
-                }
-                const String& className = childObjNode->cls;
-
-                try {
-                    if (className == "sun") {
-                        sys->setSun (new Sun (sys->getSceneMgr (), sys->getCaelumCameraNode ()));
-                        childObjNode->context = static_cast<void*> (sys->getSun ());
-                    } else if (className == "sky_dome") {
-                        sys->setSkyDome (new SkyDome (sys->getSceneMgr (), sys->getCaelumCameraNode ()));
-                        childObjNode->context = static_cast<void*>(sys->getSkyDome ());
-                    } else if (className == "moon") {
-                        sys->setMoon (new Moon (sys->getSceneMgr (), sys->getCaelumCameraNode ()));
-                        childObjNode->context = static_cast<void*>(sys->getMoon ());
-                    } else if (className == "ground_fog") {
-                        sys->setGroundFog (new GroundFog (sys->getSceneMgr (), sys->getCaelumCameraNode ()));
-                        childObjNode->context = static_cast<void*>(sys->getGroundFog ());
-                    } else if (className == "depth_composer") {
-                        sys->setDepthComposer (new DepthComposer (sys->getSceneMgr ()));
-                        childObjNode->context = static_cast<void*>(sys->getDepthComposer ());
-                    } else if (className == "point_starfield") {
-                        sys->setPointStarfield (new PointStarfield (sys->getSceneMgr (), sys->getCaelumCameraNode()));
-                        childObjNode->context = static_cast<void*>(sys->getPointStarfield ());
-                    } else if (className == "precipitation") {
-                        sys->setPrecipitationController (new PrecipitationController (sys->getSceneMgr ()));
-                        childObjNode->context = static_cast<void*>(sys->getPrecipitationController ());
-                    } else if (className == "cloud_system") {
-                        sys->setCloudSystem (new CloudSystem (sys->getSceneMgr (), sys->getCaelumGroundNode ()));
-                        childObjNode->context = static_cast<void*>(sys->getCloudSystem ());
-                    } else {
-                        LogManager::getSingleton ().logMessage ("CaelumSystemScriptTranslator::translate "
-                                "unknown child object class '" + className + "'");
-                    }
-                } catch (Caelum::UnsupportedException& ex) {
-                    // Catch all unsupported exceptions and report them.
-                    // This should usually happen because the proper shaders are not supported by hardware.
-                    //
-                    // Script parsing should still succeed.
-                    compiler->addError (
-                            ScriptCompiler::CE_UNSUPPORTEDBYRENDERSYSTEM,
-                            childObjNode->file, childObjNode->line,
-                            "Failed to create component \"" + className + "\": " + ex.getFullDescription ());
-                    continue;
-                }
-                processNode (compiler, *i);
-            }
-        }
-
-        //LogManager::getSingleton ().logMessage ("SkySystemScriptTranslator::translate END");
-    }
-
-    void CloudSystemScriptTranslator::translate (ScriptCompiler* compiler, const AbstractNodePtr& node)
-    {
-        //LogManager::getSingleton ().logMessage ("SkySystemScriptTranslator::translate begin");
-
-		ObjectAbstractNode *objNode = reinterpret_cast<ObjectAbstractNode*>(node.get());
-        assert (!objNode->context.isEmpty ());
-        void* rawTargetObject = any_cast<void*> (objNode->context);
-        assert (rawTargetObject);
-
-        CloudSystem* target = static_cast<CloudSystem*>(rawTargetObject);
-
-		for (AbstractNodeList::iterator i = objNode->children.begin(); i != objNode->children.end(); ++i)
-		{
-			if ((*i)->type == ANT_PROPERTY)
-            {
-                compiler->addError (
-                            ScriptCompiler::CE_INVALIDPARAMETERS,
-                            objNode->file, objNode->line,
-                            "cloud_system doesn't have any properties");
-			}
-			else if((*i)->type == ANT_OBJECT)
-			{
-				ObjectAbstractNode *childObjNode = reinterpret_cast<ObjectAbstractNode*>((*i).get());
-
-                /*
-                LogManager::getSingleton ().logMessage ("CloudSystemScriptTranslator::translate child object"
-                        " value '" + childObjNode->getValue () + "'"
-                        " name '" + childObjNode->name + "'"
-                        " cls '" + childObjNode->cls + "'"
-                        " base '" + childObjNode->base + "'");
-                 */
-
-                const Ogre::String& className = childObjNode->cls;
-        
-                if (className == "cloud_layer") {
-                    // Don't allow names.
-#if OGRE_VERSION < 0x010700
-                    if (childObjNode->base.empty () == false) {
-#else
-                    if (childObjNode->bases.size () != 0) {
-#endif
-                        compiler->addError (
-                                ScriptCompiler::CE_FEWERPARAMETERSEXPECTED,
-                                childObjNode->file, childObjNode->line,
-                                "cloud_layer can't have a base");
-                        continue;
-                    }
-                    // Height here is irrelevant. It's silly to have it as a FlatCloudLayer ctor parameter.
-                    target->createLayerAtHeight (0);
-                    FlatCloudLayer* layer = target->getLayer (target->getLayerCount () - 1);
-
-                    // Add the new layer as a context for the object node.
-                    // This will eventually pass to the TypeDescriptorScriptTranslator for a cloud layer.
-                    childObjNode->context = static_cast<void*>(layer);
-                } else {
-                    LogManager::getSingleton ().logMessage ("CloudSystemScriptTranslator::translate "
-                            "unknown child object class '" + className + "'");
-                }
-                processNode (compiler, *i);
-            }
-        }
-
-        //LogManager::getSingleton ().logMessage ("CloudSystemScriptTranslator::translate END");
-    }
-
-    CaelumScriptTranslatorManager::CaelumScriptTranslatorManager
-    (
-        CaelumDefaultTypeDescriptorData* typeData
-    ):
-        mCaelumSystemTranslator(),
-        mCloudSystemTranslator(),
-        mFlatCloudLayerTranslator(typeData->FlatCloudLayerTypeDescriptor),
-        mSunTranslator(typeData->BaseSkyLightTypeDescriptor),
-        mMoonTranslator(typeData->BaseSkyLightTypeDescriptor),
-        mPointStarfieldTranslator(typeData->PointStarfieldTypeDescriptor),
-        mGroundFogTranslator(typeData->GroundFogTypeDescriptor),
-        mDepthComposerTranslator(typeData->DepthComposerTypeDescriptor),
-        mPrecipitationTranslator(typeData->PrecipitationTypeDescriptor),
-        mSkyDomeTranslator(typeData->SkyDomeTypeDescriptor)
-    {
-        mCaelumSystemTranslator.setTypeDescriptor(typeData->CaelumSystemTypeDescriptor);
-
-        // Build translator map to member translators.
-        mTranslatorMap.insert (std::make_pair ("caelum_sky_system", &mCaelumSystemTranslator));
-        mTranslatorMap.insert (std::make_pair ("cloud_system", &mCloudSystemTranslator));
-        mTranslatorMap.insert (std::make_pair ("cloud_layer", &mFlatCloudLayerTranslator));
-        mTranslatorMap.insert (std::make_pair ("sun", &mSunTranslator));
-        mTranslatorMap.insert (std::make_pair ("moon", &mMoonTranslator));
-        mTranslatorMap.insert (std::make_pair ("point_starfield", &mPointStarfieldTranslator));
-        mTranslatorMap.insert (std::make_pair ("ground_fog", &mGroundFogTranslator));
-        mTranslatorMap.insert (std::make_pair ("depth_composer", &mDepthComposerTranslator));
-        mTranslatorMap.insert (std::make_pair ("precipitation", &mPrecipitationTranslator));
-        mTranslatorMap.insert (std::make_pair ("sky_dome", &mSkyDomeTranslator));
-    }
-
-    size_t CaelumScriptTranslatorManager::getNumTranslators () const {
-        // Turns out this is never called.
-        assert(0 && "This method should be removed from Ogre::ScriptTranslatorManager");
-        return mTranslatorMap.size ();
-    }
-
-    void CaelumScriptTranslatorManager::_setPropScriptResourceManager (PropScriptResourceManager* mgr)
-    {
-        mCaelumSystemTranslator.setResourceManager (mgr);
-    }
-
-    ScriptTranslator* CaelumScriptTranslatorManager::getTranslator (const AbstractNodePtr& node)
-    {
-        //LogManager::getSingleton ().logMessage ("CaelumScriptTranslatorManager::getTranslator");
-        if (node->type == ANT_ATOM) {
-            //ObjectAbstractNode* atomNode = reinterpret_cast<ObjectAbstractNode*>(node.get());
-            //LogManager::getSingleton ().logMessage ("CaelumScriptTranslatorManager::getTranslator atom node " + atomNode->getValue ());
-        } else if (node->type == ANT_OBJECT) {
-            ObjectAbstractNode* objNode = reinterpret_cast<ObjectAbstractNode*>(node.get());
-            //LogManager::getSingleton ().logMessage ("CaelumScriptTranslatorManager::getTranslator object node " + objNode->getValue ());
-
-            // Pass down the context.
-            ScriptTranslatorMap::const_iterator it = mTranslatorMap.find(objNode->cls);
-            if (it != mTranslatorMap.end()) {
-                return it->second;
-            }
-        }
-
-        // Not found in this manager.
-        return 0;
-    }
-}
-
-#endif // CAELUM_SCRIPT_SUPPORT
diff --git a/extern/caelum/src/CaelumSystem.cpp b/extern/caelum/src/CaelumSystem.cpp
deleted file mode 100644
index c0ca0ad62d..0000000000
--- a/extern/caelum/src/CaelumSystem.cpp
+++ /dev/null
@@ -1,760 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "CaelumSystem.h"
-#include "CaelumExceptions.h"
-#include "InternalUtilities.h"
-#include "Astronomy.h"
-#include "CaelumPlugin.h"
-#include "FlatCloudLayer.h"
-
-using namespace Ogre;
-
-namespace Caelum
-{
-    const String CaelumSystem::DEFAULT_SKY_GRADIENTS_IMAGE = "EarthClearSky2.png";
-    const String CaelumSystem::DEFAULT_SUN_COLOURS_IMAGE = "SunGradient.png";
-
-    CaelumSystem::CaelumSystem
-    (
-        Ogre::Root *root, 
-        Ogre::SceneManager *sceneMgr,
-        CaelumComponent componentsToCreate/* = CAELUM_COMPONENTS_DEFAULT*/
-    ):
-        mOgreRoot (root),
-        mSceneMgr (sceneMgr),
-        mCleanup (false)
-    {
-        LogManager::getSingleton().logMessage ("Caelum: Initialising Caelum system...");
-        //LogManager::getSingleton().logMessage ("Caelum: CaelumSystem* at d" +
-        //        StringConverter::toString (reinterpret_cast<uint>(this)));
-
-        Ogre::String uniqueId = Ogre::StringConverter::toString ((size_t)this);
-        if (!CaelumPlugin::getSingletonPtr ()) {
-            LogManager::getSingleton().logMessage ("Caelum: Plugin not installed; installing now.");
-            new CaelumPlugin ();
-            CaelumPlugin::getSingletonPtr ()->install ();
-            CaelumPlugin::getSingletonPtr ()->initialise ();
-        }
-
-        mCaelumCameraNode.reset(mSceneMgr->getRootSceneNode ()->createChildSceneNode ("Caelum/CameraNode/" + uniqueId));
-        mCaelumGroundNode.reset(mSceneMgr->getRootSceneNode ()->createChildSceneNode ("Caelum/GroundNode/" + uniqueId));
-        mUniversalClock.reset(new UniversalClock ());
-
-        // If the "Caelum" resource group does not exist; create it.
-        // This resource group is never released; which may be bad.
-        // What does ogre do for it's own runtime resources?
-        Ogre::StringVector groups = ResourceGroupManager::getSingleton ().getResourceGroups ();
-        if (std::find (groups.begin(), groups.end(), Caelum::RESOURCE_GROUP_NAME) == groups.end()) {
-            LogManager::getSingleton ().logMessage (
-                    "Caelum: Creating required internal resource group \'" + RESOURCE_GROUP_NAME + "\'");
-            ResourceGroupManager::getSingleton ().createResourceGroup (Caelum::RESOURCE_GROUP_NAME);
-        }
-
-        // Autoconfigure. Calls clear first to set defaults.
-        autoConfigure (componentsToCreate);
-    }
-
-    void CaelumSystem::destroySubcomponents (bool destroyEverything)
-    {
-        // Destroy sub-components
-        setSkyDome (0);
-        setSun (0);
-        setImageStarfield (0);
-        setPointStarfield (0);
-        setCloudSystem (0);
-        setPrecipitationController (0);
-        setDepthComposer (0);
-        setGroundFog (0);
-        setMoon (0);   
-        mSkyGradientsImage.reset ();
-        mSunColoursImage.reset ();
-
-        // These things can't be rebuilt.
-        if (destroyEverything) {
-            LogManager::getSingleton ().logMessage("Caelum: Delete UniversalClock");
-            mUniversalClock.reset ();
-            mCaelumCameraNode.reset ();
-            mCaelumGroundNode.reset ();
-        }
-    }
-
-    CaelumSystem::~CaelumSystem () {
-        destroySubcomponents (true);
-        LogManager::getSingleton ().logMessage ("Caelum: CaelumSystem destroyed.");
-    }
-
-    void CaelumSystem::clear()
-    {
-        // Destroy all subcomponents first.
-        destroySubcomponents (false);
-
-        // Some "magical" behaviour.
-        mAutoMoveCameraNode = true;
-        mAutoNotifyCameraChanged = true;
-        mAutoAttachViewportsToComponents = true;
-        mAutoViewportBackground = true;
-
-        // Default lookups.
-        setSkyGradientsImage(DEFAULT_SKY_GRADIENTS_IMAGE);
-        setSunColoursImage(DEFAULT_SUN_COLOURS_IMAGE);
-
-        // Fog defaults.
-        setManageSceneFog (true);
-        mGlobalFogDensityMultiplier = 1;
-        mGlobalFogColourMultiplier = Ogre::ColourValue(1.0, 1.0, 1.0, 1.0);
-        mSceneFogDensityMultiplier = 1;
-        mSceneFogColourMultiplier = Ogre::ColourValue(0.7, 0.7, 0.7, 0.7);
-        mGroundFogDensityMultiplier = 1;
-        mGroundFogColourMultiplier = Ogre::ColourValue(1.0, 1.0, 1.0, 1.0);
-
-        // Ambient lighting.
-        setManageAmbientLight (true);
-        setMinimumAmbientLight (Ogre::ColourValue (0.1, 0.1, 0.3));
-        mEnsureSingleLightSource = false;
-        mEnsureSingleShadowSource = false;
-
-        // Observer time & position. J2000 is midday.
-        mObserverLatitude = Ogre::Degree(45);
-        mObserverLongitude = Ogre::Degree(0);
-        mUniversalClock->setJulianDay (Astronomy::J2000);
-    }
-
-    void CaelumSystem::autoConfigure
-    (
-        CaelumComponent componentsToCreate/* = CAELUM_COMPONENTS_DEFAULT*/
-    )
-    {
-        // Clear everything; revert to default.
-        clear();
-
-        if (componentsToCreate == 0) {
-            // Nothing to do. Don't print junk if not creating anything.
-            return;
-        }
-        LogManager::getSingleton ().logMessage ("Caelum: Creating caelum sub-components.");
-
-        // Init skydome
-        if (componentsToCreate & CAELUM_COMPONENT_SKY_DOME) {
-            try {
-                this->setSkyDome (new SkyDome (mSceneMgr, getCaelumCameraNode ()));
-            } catch (Caelum::UnsupportedException& ex) {
-                LogManager::getSingleton ().logMessage (
-                        "Caelum: Failed to initialize skydome: " + ex.getFullDescription());
-            }
-        }
-        
-        // Init sun
-        if (componentsToCreate & CAELUM_COMPONENT_SUN) {
-            try {
-                this->setSun (new SpriteSun (mSceneMgr, getCaelumCameraNode ()));
-                this->getSun ()->setAmbientMultiplier (Ogre::ColourValue (0.5, 0.5, 0.5));
-                this->getSun ()->setDiffuseMultiplier (Ogre::ColourValue (3, 3, 2.7));
-                this->getSun ()->setSpecularMultiplier (Ogre::ColourValue (5, 5, 5));
-
-                this->getSun ()->setAutoDisable (true);
-                this->getSun ()->setAutoDisableThreshold (0.05);
-            } catch (Caelum::UnsupportedException& ex) {
-                LogManager::getSingleton ().logMessage (
-                        "Caelum: Failed to initialize sun: " + ex.getFullDescription());
-            }
-        }
-
-        // Init moon
-        if (componentsToCreate & CAELUM_COMPONENT_MOON) {
-            try {
-                this->setMoon (new Moon (mSceneMgr, getCaelumCameraNode ()));
-                this->getMoon ()->setAutoDisable (true);
-                this->getMoon ()->setAutoDisableThreshold (0.05);
-            } catch (Caelum::UnsupportedException& ex) {
-                LogManager::getSingleton ().logMessage (
-                        "Caelum: Failed to initialize moon: " + ex.getFullDescription());
-            }
-        }
-        if (componentsToCreate & CAELUM_COMPONENT_IMAGE_STARFIELD) {
-            try {
-                this->setImageStarfield (new ImageStarfield (mSceneMgr, getCaelumCameraNode ()));
-            } catch (Caelum::UnsupportedException& ex) {
-                LogManager::getSingleton ().logMessage (
-                        "Caelum: Failed to initialize the old image starfield: " + ex.getFullDescription());
-            }
-        }
-        if (componentsToCreate & CAELUM_COMPONENT_POINT_STARFIELD) {
-            try {
-                this->setPointStarfield (new PointStarfield (mSceneMgr, getCaelumCameraNode ()));
-            } catch (Caelum::UnsupportedException& ex) {
-                LogManager::getSingleton ().logMessage (
-                        "Caelum: Failed to initialize starfield: " + ex.getFullDescription());
-            }
-        }
-        if (componentsToCreate & CAELUM_COMPONENT_GROUND_FOG) {
-            try {
-               this->setGroundFog (new GroundFog (mSceneMgr, getCaelumCameraNode ()));
-            } catch (Caelum::UnsupportedException& ex) {
-                LogManager::getSingleton ().logMessage (
-                        "Caelum: Failed to initialize ground fog: " + ex.getFullDescription());
-            }
-        }
-        if (componentsToCreate & CAELUM_COMPONENT_CLOUDS) {
-            try {
-			    this->setCloudSystem (new CloudSystem (mSceneMgr, getCaelumGroundNode ()));
-                getCloudSystem ()->createLayerAtHeight (3000);		
-                getCloudSystem ()->getLayer (0)->setCloudCover (0.3);
-            } catch (Caelum::UnsupportedException& ex) {
-                LogManager::getSingleton ().logMessage (
-                        "Caelum: Failed to initialize clouds: " + ex.getFullDescription());
-            }
-        }
-        if (componentsToCreate & CAELUM_COMPONENT_PRECIPITATION) {
-            try {
-                this->setPrecipitationController (new PrecipitationController (mSceneMgr));
-            } catch (Caelum::UnsupportedException& ex) {
-                LogManager::getSingleton ().logMessage (
-                        "Caelum: Failed to initialize precipitation: " + ex.getFullDescription());
-            }
-        }
-        if (componentsToCreate & CAELUM_COMPONENT_SCREEN_SPACE_FOG) {
-            try {
-                this->setDepthComposer (new DepthComposer (mSceneMgr));
-            } catch (Caelum::UnsupportedException& ex) {
-                LogManager::getSingleton ().logMessage (
-                        "Caelum: Failed to initialize precipitation: " + ex.getFullDescription());
-            }
-        }
-
-        LogManager::getSingleton ().logMessage ("Caelum: DONE initializing");
-    }
-
-    void CaelumSystem::shutdown (const bool cleanup) {
-        LogManager::getSingleton ().logMessage ("Caelum: Shutting down Caelum system...");
-
-        destroySubcomponents (true);
-
-        if (cleanup) {
-            mOgreRoot->removeFrameListener (this);
-            delete this;
-        } else {
-            // We'll delete later. Make sure we're registered as a frame listener, or we'd leak.
-            mOgreRoot->addFrameListener(this);
-            mCleanup = true;
-        }
-    }
-
-    void CaelumSystem::attachViewportImpl (Ogre::Viewport* vp)
-    {
-        LogManager::getSingleton().getDefaultLog ()->logMessage (
-                "CaelumSystem: Attached to"
-                " viewport " + StringConverter::toString ((long)vp) +
-                " render target " + vp->getTarget ()->getName ());
-        if (getAutoAttachViewportsToComponents ()) {
-            if (getPrecipitationController ()) {
-                getPrecipitationController ()->createViewportInstance (vp);
-            }
-            if (getDepthComposer ()) {
-                getDepthComposer ()->createViewportInstance (vp);
-            }
-        }
-    }
-
-    void CaelumSystem::detachViewportImpl (Ogre::Viewport* vp)
-    {
-        LogManager::getSingleton().getDefaultLog ()->logMessage (
-                "CaelumSystem: Detached from "
-                " viewport " + StringConverter::toString ((long)vp) +
-                " render target " + vp->getTarget ()->getName ());
-        if (getAutoAttachViewportsToComponents ()) {
-            if (getPrecipitationController ()) {
-                getPrecipitationController ()->destroyViewportInstance (vp);
-            }
-            if (getDepthComposer ()) {
-                getDepthComposer ()->destroyViewportInstance (vp);
-            }
-        }
-    }
-    
-    void CaelumSystem::attachViewport (Ogre::Viewport* vp)
-    {
-        bool found = !mAttachedViewports.insert (vp).second;
-        if (!found) {
-            attachViewportImpl (vp);
-        }
-    }
-
-    void CaelumSystem::detachViewport (Ogre::Viewport* vp)
-    {
-        std::set<Viewport*>::size_type erase_result = mAttachedViewports.erase(vp);
-        assert(erase_result == 0 || erase_result == 1);
-        bool found = erase_result == 1;
-        if (found) {
-            detachViewportImpl (vp);
-        }
-    }
-
-    void CaelumSystem::detachAllViewports ()
-    {
-        std::set<Viewport*>::const_iterator it = mAttachedViewports.begin(), end = mAttachedViewports.end();
-        for (; it != end; ++it) {
-            detachViewportImpl (*it);
-        }
-        mAttachedViewports.clear();
-    }
-
-    bool CaelumSystem::isViewportAttached (Ogre::Viewport* vp) const {
-        return mAttachedViewports.find (vp) != mAttachedViewports.end();
-    }
-
-    void CaelumSystem::setSkyDome (SkyDome *obj) {
-        mSkyDome.reset (obj);
-    }
-
-    void CaelumSystem::setSun (BaseSkyLight* obj) {
-        mSun.reset (obj);
-    }
-
-    void CaelumSystem::setMoon (Moon* obj) {
-        mMoon.reset (obj);
-    }
-
-    void CaelumSystem::setImageStarfield (ImageStarfield* obj) {
-        mImageStarfield.reset (obj);
-    }
-
-    void CaelumSystem::setPointStarfield (PointStarfield* obj) {
-        mPointStarfield.reset (obj);
-    }
-
-    void CaelumSystem::setGroundFog (GroundFog* obj) {
-        mGroundFog.reset (obj);
-    }
-
-    void CaelumSystem::setCloudSystem (CloudSystem* obj) {
-        mCloudSystem.reset (obj);
-    }
-
-    void CaelumSystem::setPrecipitationController (PrecipitationController* newptr) {
-        PrecipitationController* oldptr = getPrecipitationController ();
-        if (oldptr == newptr) {
-            return;
-        }
-        // Detach old
-        if (getAutoAttachViewportsToComponents() && oldptr) {
-            std::for_each (mAttachedViewports.begin(), mAttachedViewports.end(),
-                    std::bind1st (std::mem_fun (&PrecipitationController::destroyViewportInstance), oldptr));
-        }
-        // Attach new.
-        if (getAutoAttachViewportsToComponents() && newptr) {
-            std::for_each (mAttachedViewports.begin(), mAttachedViewports.end(),
-                    std::bind1st (std::mem_fun (&PrecipitationController::createViewportInstance), newptr));
-        }
-        mPrecipitationController.reset(newptr);
-    }
-
-    void CaelumSystem::setDepthComposer (DepthComposer* ptr) {
-        mDepthComposer.reset(ptr);
-        if (getAutoAttachViewportsToComponents() && getDepthComposer ()) {
-            std::for_each (
-                    mAttachedViewports.begin(), mAttachedViewports.end(),
-                    std::bind1st (
-                            std::mem_fun (&DepthComposer::createViewportInstance),
-                            getDepthComposer ()));
-        }
-    }
-
-    void CaelumSystem::preViewportUpdate (const Ogre::RenderTargetViewportEvent &e) {
-        Ogre::Viewport *viewport = e.source;
-        Ogre::Camera *camera = viewport->getCamera ();
-
-        if (getAutoViewportBackground ()) {
-            viewport->setBackgroundColour (Ogre::ColourValue::Black);
-        }
-        if (getAutoNotifyCameraChanged ()) {
-            this->notifyCameraChanged (camera);
-        }
-    }
-
-    void CaelumSystem::notifyCameraChanged(Ogre::Camera* cam)
-    {
-        // Move camera node.
-        if (getAutoMoveCameraNode ()) {
-            mCaelumCameraNode->setPosition (cam->getDerivedPosition());
-            mCaelumCameraNode->_update (true, true);
-        }
-
-        if (getSkyDome ()) {
-            getSkyDome ()->notifyCameraChanged (cam);
-        }
-
-        if (getSun ()) {
-            getSun ()->notifyCameraChanged (cam);
-        }
-
-        if (getMoon ()) {
-            getMoon ()->notifyCameraChanged (cam);
-        }
-
-        if (getImageStarfield ()) {
-            getImageStarfield ()->notifyCameraChanged (cam);
-        }
-
-        if (getPointStarfield ()) {
-            getPointStarfield ()->notifyCameraChanged (cam);
-        }
-        
-        if (getGroundFog ()) {
-            getGroundFog ()->notifyCameraChanged (cam);
-        }
-    }
-                    
-    bool CaelumSystem::frameStarted (const Ogre::FrameEvent &e) {
-        if (mCleanup) {
-            // Delayed destruction.
-            mOgreRoot->removeFrameListener (this);
-            delete this;
-            return true;
-        }
-
-        updateSubcomponents(e.timeSinceLastFrame);
-
-        return true;
-    }
-
-    void CaelumSystem::updateSubcomponents (Real timeSinceLastFrame)
-    {
-        /*
-        LogManager::getSingleton().getDefaultLog()->logMessage(
-                "CaelumSystem::updateSubcomponents: " +
-                StringConverter::toString (timeSinceLastFrame, 10));
-        */
-
-        mUniversalClock->update (timeSinceLastFrame);
-
-        // Timing variables
-        LongReal julDay = mUniversalClock->getJulianDay ();
-        LongReal relDayTime = fmod(julDay, 1);
-        Real secondDiff = timeSinceLastFrame * mUniversalClock->getTimeScale ();
-
-        // Get astronomical parameters.
-        Ogre::Vector3 sunDir = getSunDirection(julDay);    
-        Ogre::Vector3 moonDir = getMoonDirection(julDay);  
-        Real moonPhase = getMoonPhase(julDay);    
-
-        // Get parameters from sky colour model.
-        Real fogDensity = getFogDensity (relDayTime, sunDir);           
-        Ogre::ColourValue fogColour = getFogColour (relDayTime, sunDir);                  
-        Ogre::ColourValue sunLightColour = getSunLightColour (relDayTime, sunDir);
-        Ogre::ColourValue sunSphereColour = getSunSphereColour (relDayTime, sunDir);
-        Ogre::ColourValue moonLightColour = getMoonLightColour (moonDir);
-        Ogre::ColourValue moonBodyColour = getMoonBodyColour (moonDir); 
-
-        fogDensity *= mGlobalFogDensityMultiplier;
-        fogColour = fogColour * mGlobalFogColourMultiplier;
-
-        // Update image starfield
-        if (getImageStarfield ()) {
-            getImageStarfield ()->update (relDayTime);
-            getImageStarfield ()->setInclination (-getObserverLatitude ());
-        }
-
-        // Update point starfield
-        if (getPointStarfield ()) {
-            getPointStarfield ()->setObserverLatitude (getObserverLatitude ());
-            getPointStarfield ()->setObserverLongitude (getObserverLongitude ());
-            getPointStarfield ()->_update (relDayTime);
-        }
-
-        // Update skydome.
-        if (getSkyDome ()) {
-            getSkyDome ()->setSunDirection (sunDir);
-            getSkyDome ()->setHazeColour (fogColour * mSceneFogColourMultiplier);
-        }
-
-        // Update scene fog.
-        if (getManageSceneFog ()) {
-            mSceneMgr->setFog (Ogre::FOG_EXP2,
-                    fogColour * mSceneFogColourMultiplier,
-                    fogDensity * mSceneFogDensityMultiplier);
-        }
-
-        // Update ground fog.
-        if (getGroundFog ()) {
-            getGroundFog ()->setColour (fogColour * mGroundFogColourMultiplier);
-            getGroundFog ()->setDensity (fogDensity * mGroundFogDensityMultiplier);
-        }
-
-        // Update sun
-        if (getSun ()) {
-            mSun->update (sunDir, sunLightColour, sunSphereColour);
-        }
-
-        // Update moon.
-        if (getMoon ()) {
-            mMoon->update (
-                    moonDir,
-                    moonLightColour,
-                    moonBodyColour);
-            mMoon->setPhase (moonPhase);
-        }
-
-        // Update clouds
-        if (getCloudSystem ()) {
-            getCloudSystem ()->update (
-                    secondDiff, sunDir, sunLightColour, fogColour, sunSphereColour);
-        }
-
-        // Update precipitation
-        if (getPrecipitationController ()) {
-            getPrecipitationController ()->update (secondDiff, fogColour);
-        }
-
-        // Update screen space fog
-        if (getDepthComposer ()) {
-            getDepthComposer ()->update ();
-            getDepthComposer ()->setSunDirection (sunDir);
-            getDepthComposer ()->setHazeColour (fogColour);
-            getDepthComposer ()->setGroundFogColour (fogColour * mGroundFogColourMultiplier);
-            getDepthComposer ()->setGroundFogDensity (fogDensity * mGroundFogDensityMultiplier);
-        }
-
-        // Update ambient lighting.
-        if (getManageAmbientLight ()) {
-            Ogre::ColourValue ambient = Ogre::ColourValue::Black;
-            if (getMoon ()) {
-                ambient += getMoon ()->getLightColour () * getMoon ()->getAmbientMultiplier ();
-            }
-            if (getSun ()) {
-                ambient += getSun ()->getLightColour () * getSun ()->getAmbientMultiplier ();
-            }
-            ambient.r = std::max(ambient.r, mMinimumAmbientLight.r);
-            ambient.g = std::max(ambient.g, mMinimumAmbientLight.g);
-            ambient.b = std::max(ambient.b, mMinimumAmbientLight.b);
-            ambient.a = std::max(ambient.a, mMinimumAmbientLight.a);
-            // Debug ambient factos (ick).
-            /*
-            LogManager::getSingleton().logMessage (
-                        "Sun is " + StringConverter::toString(sunLightColour) + "\n"
-                        "Moon is " + StringConverter::toString(moonLightColour) + "\n"
-                        "Ambient is " + StringConverter::toString(ambient) + "\n"
-                        );
-             */
-            mSceneMgr->setAmbientLight (ambient);
-        }
-
-        if (getSun() && getMoon ()) {
-            Ogre::Real moonBrightness = moonLightColour.r + moonLightColour.g + moonLightColour.b + moonLightColour.a;
-            Ogre::Real sunBrightness = sunLightColour.r + sunLightColour.g + sunLightColour.b + sunLightColour.a;
-            bool sunBrighterThanMoon = (sunBrightness > moonBrightness);
-
-            if (getEnsureSingleLightSource ()) {
-                getMoon ()->setForceDisable (sunBrighterThanMoon);
-                getSun ()->setForceDisable (!sunBrighterThanMoon);
-            }
-            if (getEnsureSingleShadowSource ()) {
-                getMoon ()->getMainLight ()->setCastShadows (!sunBrighterThanMoon);
-                getSun ()->getMainLight ()->setCastShadows (sunBrighterThanMoon);
-            }
-        }
-    }
-
-    void CaelumSystem::setManageSceneFog (bool value) {
-        mManageSceneFog = value;
-        // Prevent having some stale values around.
-        if (!value) {
-            mSceneMgr->setFog (Ogre::FOG_NONE);
-        }
-    }
-
-    bool CaelumSystem::getManageSceneFog () const {
-        return mManageSceneFog;
-    }
-
-    void CaelumSystem::setSceneFogDensityMultiplier (Real value) {
-        mSceneFogDensityMultiplier = value;
-    }
-
-    Real CaelumSystem::getSceneFogDensityMultiplier () const {
-        return mSceneFogDensityMultiplier;
-    }
-
-    void CaelumSystem::setGroundFogDensityMultiplier (Real value) {
-        mGroundFogDensityMultiplier = value;
-    }
-
-    Real CaelumSystem::getGroundFogDensityMultiplier () const {
-        return mGroundFogDensityMultiplier;
-    }
-
-    void CaelumSystem::setGlobalFogDensityMultiplier (Real value) {
-        mGlobalFogDensityMultiplier = value;
-    }
-
-    Real CaelumSystem::getGlobalFogDensityMultiplier () const {
-        return mGlobalFogDensityMultiplier;
-    }
-
-    void CaelumSystem::setSkyGradientsImage (const Ogre::String &filename) {
-        mSkyGradientsImage.reset(new Ogre::Image ());
-        mSkyGradientsImage->load (filename, RESOURCE_GROUP_NAME);
-    }
-
-    void CaelumSystem::setSunColoursImage (const Ogre::String &filename) {
-        mSunColoursImage.reset(new Ogre::Image ());
-        mSunColoursImage->load (filename, RESOURCE_GROUP_NAME);
-    }
-
-    Ogre::ColourValue CaelumSystem::getFogColour (Real time, const Ogre::Vector3 &sunDir) {
-        if (!mSkyGradientsImage.get()) {
-            return Ogre::ColourValue::Black;
-        }
-
-        Real elevation = sunDir.dotProduct (Ogre::Vector3::UNIT_Y) * 0.5 + 0.5;
-        Ogre::ColourValue col = InternalUtilities::getInterpolatedColour (elevation, 1, mSkyGradientsImage.get(), false);
-        return col;
-    }
-
-    Real CaelumSystem::getFogDensity (Real time, const Ogre::Vector3 &sunDir)
-    {
-        if (!mSkyGradientsImage.get()) {
-            return 0;
-        }
-
-        Real elevation = sunDir.dotProduct (Ogre::Vector3::UNIT_Y) * 0.5 + 0.5;
-        Ogre::ColourValue col = InternalUtilities::getInterpolatedColour (elevation, 1, mSkyGradientsImage.get(), false);
-        return col.a;
-    }
-
-    Ogre::ColourValue CaelumSystem::getSunSphereColour (Real time, const Ogre::Vector3 &sunDir)
-    {
-        if (!mSunColoursImage.get()) {
-            return Ogre::ColourValue::White;
-        }
-
-        Real elevation = sunDir.dotProduct (Ogre::Vector3::UNIT_Y);
-        elevation = elevation * 2 + 0.4;
-        return InternalUtilities::getInterpolatedColour (elevation, 1, mSunColoursImage.get(), false);
-    }
-
-    Ogre::ColourValue CaelumSystem::getSunLightColour (Real time, const Ogre::Vector3 &sunDir)
-    {
-        if (!mSkyGradientsImage.get()) {
-            exit(-1);
-            return Ogre::ColourValue::White;
-        }
-        Real elevation = sunDir.dotProduct (Ogre::Vector3::UNIT_Y) * 0.5 + 0.5;
-
-        // Hack: return averaged sky colours.
-        // Don't use an alpha value for lights, this can cause nasty problems.
-        Ogre::ColourValue col = InternalUtilities::getInterpolatedColour (elevation, elevation, mSkyGradientsImage.get(), false);
-        Real val = (col.r + col.g + col.b) / 3;
-        col = Ogre::ColourValue(val, val, val, 1.0);
-        assert(Ogre::Math::RealEqual(col.a, 1));
-        return col;
-    }
-
-    Ogre::ColourValue CaelumSystem::getMoonBodyColour (const Ogre::Vector3 &moonDir) {
-        return Ogre::ColourValue::White;
-    }
-
-    Ogre::ColourValue CaelumSystem::getMoonLightColour (const Ogre::Vector3 &moonDir)
-    {
-        if (!mSkyGradientsImage.get()) {
-            return Ogre::ColourValue::Blue;
-        }
-        // Scaled version of getSunLightColor
-        Real elevation = moonDir.dotProduct (Ogre::Vector3::UNIT_Y) * 0.5 + 0.5;
-        Ogre::ColourValue col = InternalUtilities::getInterpolatedColour (elevation, elevation, mSkyGradientsImage.get(), false);
-        Real val = (col.r + col.g + col.b) / 3;
-        col = Ogre::ColourValue(val / 2.5f, val / 2.5f, val / 2.5f, 1.0);
-        assert(Ogre::Math::RealEqual(col.a, 1));
-        return col;
-    }
-
-    const Ogre::Vector3 CaelumSystem::makeDirection (
-            Ogre::Degree azimuth, Ogre::Degree altitude)
-    {
-        Ogre::Vector3 res;
-        res.z = -Ogre::Math::Cos (azimuth) * Ogre::Math::Cos (altitude);  // North 
-        res.x =  Ogre::Math::Sin (azimuth) * Ogre::Math::Cos (altitude);  // East
-        res.y = -Ogre::Math::Sin (altitude); // Zenith
-        return res;
-    }
-
-    const Ogre::Vector3 CaelumSystem::getSunDirection (LongReal jday)
-    {
-        Ogre::Degree azimuth, altitude;
-        {
-            ScopedHighPrecissionFloatSwitch precissionSwitch;
-    		                  
-		    Astronomy::getHorizontalSunPosition(jday,
-                    getObserverLongitude(), getObserverLatitude(),
-                    azimuth, altitude);		
-        }
-        Ogre::Vector3 res = makeDirection(azimuth, altitude);
-
-        return res;
-    }
-
-	const Ogre::Vector3 CaelumSystem::getMoonDirection (LongReal jday)
-    {
-        Ogre::Degree azimuth, altitude;
-        {
-            ScopedHighPrecissionFloatSwitch precissionSwitch;
-
-            Astronomy::getHorizontalMoonPosition(jday,
-                    getObserverLongitude (), getObserverLatitude (),
-                    azimuth, altitude);
-        }	
-        Ogre::Vector3 res = makeDirection(azimuth, altitude);
-
-		return res;
-	}
-
-    const Ogre::Real CaelumSystem::getMoonPhase (LongReal jday)
-    {
-        // Calculates julian days since January 22, 2008 13:36 (full moon)
-        // and divides by the time between lunations (synodic month)
-        LongReal T = (jday - 2454488.0665L) / 29.531026L;
-
-        T = fabs(fmod(T, 1));
-        return -fabs(-4 * T + 2) + 2;
-    }
-
-    void CaelumSystem::forceSubcomponentQueryFlags (uint flags)
-    {
-        if (getSkyDome ()) getSkyDome ()->setQueryFlags (flags);
-        if (getSun ()) getSun ()->setQueryFlags (flags);
-        if (getMoon ()) getMoon ()->setQueryFlags (flags);
-        if (getImageStarfield ()) getImageStarfield ()->setQueryFlags (flags);
-        if (getPointStarfield ()) getPointStarfield ()->setQueryFlags (flags);        
-        if (getGroundFog ()) getGroundFog ()->setQueryFlags (flags);
-        if (getCloudSystem ()) getCloudSystem ()->forceLayerQueryFlags (flags);
-    }
-
-    void CaelumSystem::forceSubcomponentVisibilityFlags (uint flags)
-    {
-        if (getSkyDome ()) getSkyDome ()->setVisibilityFlags (flags);
-        if (getSun ()) getSun ()->setVisibilityFlags (flags);
-        if (getMoon ()) getMoon ()->setVisibilityFlags (flags);
-        if (getImageStarfield ()) getImageStarfield ()->setVisibilityFlags (flags);
-        if (getPointStarfield ()) getPointStarfield ()->setVisibilityFlags (flags);        
-        if (getGroundFog ()) getGroundFog ()->setVisibilityFlags (flags);
-        if (getCloudSystem ()) getCloudSystem ()->forceLayerVisibilityFlags (flags);
-    }
-}
diff --git a/extern/caelum/src/CameraBoundElement.cpp b/extern/caelum/src/CameraBoundElement.cpp
deleted file mode 100644
index 027520e6e9..0000000000
--- a/extern/caelum/src/CameraBoundElement.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "CameraBoundElement.h"
-
-namespace Caelum
-{
-    const Ogre::Real CameraBoundElement::CAMERA_NEAR_DISTANCE_MULTIPLIER = 10;
-
-    CameraBoundElement::CameraBoundElement():
-            mAutoRadius(true)
-    {
-    }
-
-    CameraBoundElement::~CameraBoundElement()
-    {
-    }
-
-    void CameraBoundElement::notifyCameraChanged (Ogre::Camera *cam) {
-	    if (mAutoRadius) {
-            if (cam->getFarClipDistance () > 0) {
-                setFarRadius((cam->getFarClipDistance () + cam->getNearClipDistance ()) / 2);
-            } else {
-                setFarRadius(cam->getNearClipDistance () * CAMERA_NEAR_DISTANCE_MULTIPLIER);
-            }
-	    }	
-    }
-
-    void CameraBoundElement::forceFarRadius (Ogre::Real radius) {
-        if (radius > 0) {
-            mAutoRadius = false;
-            setFarRadius(radius);
-        } else {
-            mAutoRadius = true;
-        }
-    }
-
-    bool CameraBoundElement::getAutoRadius () const {
-        return mAutoRadius;
-    }
-
-    void CameraBoundElement::setAutoRadius () {
-        forceFarRadius (-1);
-    }
-
-    void CameraBoundElement::setFarRadius(Ogre::Real radius) {
-    }
-}
diff --git a/extern/caelum/src/CloudSystem.cpp b/extern/caelum/src/CloudSystem.cpp
deleted file mode 100644
index bb7e12485c..0000000000
--- a/extern/caelum/src/CloudSystem.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "CloudSystem.h"
-#include "FlatCloudLayer.h"
-
-using namespace Ogre;
-
-namespace Caelum
-{
-    CloudSystem::CloudSystem(
-		    Ogre::SceneManager *sceneMgr,
-		    Ogre::SceneNode *cloudRoot)
-    {
-        mSceneMgr = sceneMgr;
-        mCloudRoot = cloudRoot;
-    }
-
-    FlatCloudLayer* CloudSystem::createLayerAtHeight(Ogre::Real height)
-    {
-        FlatCloudLayer* layer = this->createLayer ();
-        layer->setHeight(height);
-        return layer;
-    }
-
-    FlatCloudLayer* CloudSystem::createLayer()
-    {
-        std::auto_ptr<FlatCloudLayer> layer(new FlatCloudLayer(mSceneMgr, mCloudRoot));
-        mLayers.push_back(layer.get());
-        return layer.release();
-    }
-
-    void CloudSystem::addLayer(FlatCloudLayer* layer)
-    {
-        assert(layer != NULL);
-        mLayers.push_back(layer);
-    }
-
-    void CloudSystem::clearLayers()
-    {
-	    for (unsigned i = 0; i < mLayers.size(); i++)
-        {
-		    delete mLayers[i];
-		    mLayers[i] = 0;
-	    }
-    }
-
-    CloudSystem::~CloudSystem()
-    {
-	    clearLayers ();
-    }
-
-    void CloudSystem::update(
-		    Ogre::Real timePassed,
-		    const Ogre::Vector3 &sunDirection,
-		    const Ogre::ColourValue &sunLightColour,
-		    const Ogre::ColourValue &fogColour,
-		    const Ogre::ColourValue &sunSphereColour)
-    {
-	    for (uint i = 0; i < mLayers.size(); i++) {
-            assert(mLayers[i] != NULL);
-		    mLayers[i]->update(timePassed, sunDirection, sunLightColour, fogColour, sunSphereColour);
-	    }
-    }
-
-    void CloudSystem::forceLayerQueryFlags (uint flags) {
-	    for (uint i = 0; i < mLayers.size(); i++) {
-		    mLayers[i]->setQueryFlags (flags);
-	    }
-    }
-
-    void CloudSystem::forceLayerVisibilityFlags (uint flags) {
-	    for (uint i = 0; i < mLayers.size(); i++) {
-		    mLayers[i]->setVisibilityFlags (flags);
-	    }
-    }
-}
diff --git a/extern/caelum/src/DepthComposer.cpp b/extern/caelum/src/DepthComposer.cpp
deleted file mode 100644
index df0572a284..0000000000
--- a/extern/caelum/src/DepthComposer.cpp
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "CaelumExceptions.h"
-#include "DepthComposer.h"
-
-using namespace Ogre;
-
-namespace Caelum
-{
-	DepthComposer::DepthComposer
-    (
-        Ogre::SceneManager *sceneMgr
-    ):
-		mSceneMgr (sceneMgr),
-        mDebugDepthRender (false),
-        mSkyDomeHazeEnabled (false),
-        mGroundFogEnabled (false),
-        mGroundFogDensity (0.1),
-        mGroundFogBaseLevel (5),
-        mGroundFogVerticalDecay (0.2),
-        mGroundFogColour (ColourValue::Black)
-    {
-	}
-
-	DepthComposer::~DepthComposer()
-    {
-        destroyAllViewportInstances();
-	}
-
-    void DepthComposer::setDebugDepthRender (bool value)
-    {
-        if (mDebugDepthRender == value) {
-            return;
-        }
-        mDebugDepthRender = value;
-        onCompositorMaterialChanged ();
-    }
-
-    void DepthComposer::setSkyDomeHazeEnabled (bool value)
-    {
-        if (mSkyDomeHazeEnabled == value) {
-            return;
-        }
-        mSkyDomeHazeEnabled = value;
-        onCompositorMaterialChanged ();
-    }
-
-    void DepthComposer::setGroundFogEnabled (bool value)
-    {
-        if (mGroundFogEnabled == value) {
-            return;
-        }
-        mGroundFogEnabled = value;
-        onCompositorMaterialChanged ();
-    }
-
-    const String& DepthComposer::getCompositorName ()
-    {
-        // Constant Ogre::Strings for names.
-        static const Ogre::String CompositorName_DebugDepthRender =
-                          "Caelum/DepthComposer_DebugDepthRender";
-        static const Ogre::String CompositorName_Dummy =
-                          "Caelum/DepthComposer_Dummy";
-        static const Ogre::String CompositorName_ExpGroundFog =
-                          "Caelum/DepthComposer_ExpGroundFog";
-        static const Ogre::String CompositorName_SkyDomeHaze =
-                          "Caelum/DepthComposer_SkyDomeHaze";
-        static const Ogre::String CompositorName_SkyDomeHaze_ExpGroundFog =
-                          "Caelum/DepthComposer_SkyDomeHaze_ExpGroundFog";
-
-        // Should probably build materials and compositors by hand.
-        if (mDebugDepthRender) {
-            return CompositorName_DebugDepthRender;
-        } else if (mSkyDomeHazeEnabled == false && mGroundFogEnabled == false) {
-            return CompositorName_Dummy;
-        } else if (mSkyDomeHazeEnabled == false && mGroundFogEnabled == true) {
-            return CompositorName_ExpGroundFog;
-        } else if (mSkyDomeHazeEnabled == true && mGroundFogEnabled == false) {
-            return CompositorName_SkyDomeHaze;
-        } else if (mSkyDomeHazeEnabled == true && mGroundFogEnabled == true) {
-            return CompositorName_SkyDomeHaze_ExpGroundFog;
-        } else {
-            assert (0);
-            return CompositorName_Dummy;
-        }
-    }
-
-    void DepthComposer::onCompositorMaterialChanged ()
-    {
-        ViewportInstanceMap::const_iterator it;
-        ViewportInstanceMap::const_iterator begin = mViewportInstanceMap.begin();
-        ViewportInstanceMap::const_iterator end = mViewportInstanceMap.end();
-        for (it = begin; it != end; ++it) {
-            it->second->removeCompositor ();
-            it->second->addCompositor ();
-        }
-    }
-
-	void DepthComposer::update ()
-    {
-        ViewportInstanceMap::const_iterator it;
-        ViewportInstanceMap::const_iterator begin = mViewportInstanceMap.begin();
-        ViewportInstanceMap::const_iterator end = mViewportInstanceMap.end();
-        for (it = begin; it != end; ++it) {
-            assert(it->first == it->second->getViewport());
-            it->second->_update ();
-        }
-	}
-
-    DepthComposerInstance::DepthComposerInstance
-    (
-        DepthComposer* parent,
-        Ogre::Viewport* viewport
-    ):
-        mParent(parent),
-        mViewport(viewport),
-        mCompInst(0)
-    {
-        LogManager::getSingleton().logMessage (
-                "Caelum::DepthComposer: Attaching screen-space fog instance"
-                " to viewport \'" + StringConverter::toString ((long)getViewport ()) + "\'"
-                " of render target \'" + getViewport()->getTarget ()->getName () + "\'");
-
-        addCompositor ();
-        mDepthRenderer.reset (new DepthRenderer (getViewport ()));
-    }
-
-    DepthComposerInstance::~DepthComposerInstance()
-    {
-        removeCompositor ();
-        mDepthRenderer.reset ();
-
-        LogManager::getSingleton().logMessage (
-                "Caelum::DepthComposer: Detached screen-space fog instance"
-                " from viewport \'" + StringConverter::toString ((long)getViewport ()) + "\'"
-                " of render target \'" + getViewport()->getTarget ()->getName () + "\'");
-    }
-
-    void DepthComposerInstance::addCompositor ()
-    {
-        CompositorManager* compMgr = CompositorManager::getSingletonPtr();
-
-        const String& compositorName = getParent ()->getCompositorName ();
-        mCompInst = compMgr->addCompositor(mViewport, compositorName);
-        if (!mCompInst) {
-            CAELUM_THROW_UNSUPPORTED_EXCEPTION (
-                    "Can't add \'" + compositorName + "\' compositor.",
-                    "DepthComposer");
-        }
-        assert(mCompInst);
-		mCompInst->setEnabled (true);
-		mCompInst->addListener (this);
-    }
-
-    void DepthComposerInstance::removeCompositor ()
-    {
-        CompositorManager* compMgr = CompositorManager::getSingletonPtr();
-        compMgr->removeCompositor (mViewport, mCompInst->getCompositor ()->getName ());
-        mCompInst = 0;
-    }
-
-	void DepthComposerInstance::notifyMaterialSetup(uint pass_id, Ogre::MaterialPtr &mat)
-	{
-        //LogManager::getSingleton ().logMessage (
-        //            "Caelum::DepthComposer: Material setup");
-
-        Pass* pass = mat->getBestTechnique ()->getPass (0);
-
-        TextureUnitState *depthTus = pass->getTextureUnitState(1);
-        if (depthTus->getTextureName () != mDepthRenderer->getDepthRenderTexture ()->getName()) {
-            depthTus->setTextureName (mDepthRenderer->getDepthRenderTexture ()->getName ());
-            LogManager::getSingleton ().logMessage (
-                        "Caelum::DepthComposer: Assigned depth texture in compositor material");
-        }
-
-        mParams.setup(pass->getFragmentProgramParameters ());
-	}
-
-    void DepthComposerInstance::Params::setup(Ogre::GpuProgramParametersSharedPtr fpParams)
-    {
-        this->fpParams = fpParams;
-        invViewProjMatrix.bind(fpParams, "invViewProjMatrix");
-        worldCameraPos.bind(fpParams, "worldCameraPos");
-        groundFogDensity.bind(fpParams, "groundFogDensity");
-        groundFogVerticalDecay.bind(fpParams, "groundFogVerticalDecay");
-        groundFogBaseLevel.bind(fpParams, "groundFogBaseLevel");
-        groundFogColour.bind(fpParams, "groundFogColour");
-        sunDirection.bind(fpParams, "sunDirection");
-        hazeColour.bind(fpParams, "hazeColour");
-    }
-
-	void DepthComposerInstance::notifyMaterialRender(uint pass_id, Ogre::MaterialPtr &mat)
-	{
-        Camera* camera = getViewport ()->getCamera ();
-
-        assert(mParams.fpParams == mat->getBestTechnique ()->getPass (0)->getFragmentProgramParameters ());
-
-        // Auto param in a compositor does not use the external camera.
-        // This means that sending matrices as auto_param will not work as expected.
-        // Do it manually instead.
-        Matrix4 projMatrix = camera->getProjectionMatrixWithRSDepth();
-        Matrix4 viewMatrix = camera->getViewMatrix();
-
-        mParams.invViewProjMatrix.set(mParams.fpParams, (projMatrix * viewMatrix).inverse());
-
-        mParams.worldCameraPos.set(mParams.fpParams, camera->getDerivedPosition ());
-
-        mParams.groundFogDensity.set(mParams.fpParams, getParent ()->getGroundFogDensity ());
-        mParams.groundFogVerticalDecay.set(mParams.fpParams, getParent ()->getGroundFogVerticalDecay ());
-        mParams.groundFogBaseLevel.set(mParams.fpParams, getParent ()->getGroundFogBaseLevel ());
-        mParams.groundFogColour.set(mParams.fpParams, getParent ()->getGroundFogColour ());
-
-        mParams.sunDirection.set(mParams.fpParams, getParent ()->getSunDirection ());
-        mParams.hazeColour.set(mParams.fpParams, getParent ()->getHazeColour ());
-	}
-
-	void DepthComposerInstance::_update ()
-    {
-        mDepthRenderer->update ();
-    }
-
-    DepthComposerInstance* DepthComposer::createViewportInstance(Ogre::Viewport* vp)
-    {
-        ViewportInstanceMap::const_iterator it = mViewportInstanceMap.find(vp);
-        if (it == mViewportInstanceMap.end()) {
-            std::auto_ptr<DepthComposerInstance> inst(new DepthComposerInstance(this, vp));
-            mViewportInstanceMap.insert(std::make_pair(vp, inst.get()));
-            // hold instance until successfully added to map.
-            return inst.release();
-        } else {
-            return it->second;
-        }
-    }
-    
-    DepthComposerInstance* DepthComposer::getViewportInstance(Ogre::Viewport* vp) {
-        ViewportInstanceMap::iterator it = mViewportInstanceMap.find(vp);
-        if (it != mViewportInstanceMap.end()) {
-            return it->second;
-        } else {
-            return 0;
-        }
-    }
-
-    void DepthComposer::destroyViewportInstance(Viewport* vp)
-    {
-        ViewportInstanceMap::iterator it = mViewportInstanceMap.find(vp);
-        if (it != mViewportInstanceMap.end()) {
-            DepthComposerInstance* inst = it->second;
-            delete inst;
-            mViewportInstanceMap.erase(it);
-        }
-    }
-
-    void DepthComposer::destroyAllViewportInstances() {
-        ViewportInstanceMap::const_iterator it;
-        ViewportInstanceMap::const_iterator begin = mViewportInstanceMap.begin();
-        ViewportInstanceMap::const_iterator end = mViewportInstanceMap.end();
-        for (it = begin; it != end; ++it) {
-            assert(it->first == it->second->getViewport());
-            delete it->second;
-        }
-        mViewportInstanceMap.clear();
-    }
-
-	const String DepthRenderer::DEFAULT_CUSTOM_DEPTH_SCHEME_NAME = "CaelumDepth";
-
-    DepthRenderer::DepthRenderer
-    (
-        Viewport* masterViewport
-    ):
-        mMasterViewport (masterViewport),
-        mDepthRenderViewport (0),
-        mDepthRenderingNow (false),
-        mViewportVisibilityMask (~0),
-        mUseCustomDepthScheme (true),
-        mCustomDepthSchemeName (DEFAULT_CUSTOM_DEPTH_SCHEME_NAME)
-    {
-        disableRenderGroupRangeFilter ();
-
-		Ogre::String uniqueId = Ogre::StringConverter::toString ((size_t)this);
-
-        // Not cloned!
-        mDepthRenderMaterial = MaterialManager::getSingleton ().getByName ("Caelum/DepthRender");
-        mDepthRenderMaterial->load();
-        if (!mDepthRenderMaterial->getBestTechnique ()) {
-            CAELUM_THROW_UNSUPPORTED_EXCEPTION (
-                    "Can't load depth render material: " +
-                    mDepthRenderMaterial->getUnsupportedTechniquesExplanation(),
-                    "DepthComposer");
-        }
-
-        TextureManager* texMgr = TextureManager::getSingletonPtr();
-
-        int width = getMasterViewport ()->getActualWidth ();
-        int height = getMasterViewport ()->getActualHeight ();
-        LogManager::getSingleton ().logMessage (
-                    "Caelum::DepthRenderer: Creating depth render texture size " +
-                    StringConverter::toString (width) + 
-                    "x" + 
-                    StringConverter::toString (height));
-
-        PixelFormat desiredFormat = PF_FLOAT32_R;
-        PixelFormat requestFormat = desiredFormat;
-        if (texMgr->isFormatSupported (TEX_TYPE_2D, desiredFormat, TU_RENDERTARGET)) {
-            LogManager::getSingleton ().logMessage (
-                    "Caelum::DepthRenderer: RenderSystem has native support for " +
-                    PixelUtil::getFormatName (desiredFormat));
-        } else if (texMgr->isEquivalentFormatSupported (TEX_TYPE_2D, desiredFormat, TU_RENDERTARGET)) {
-            PixelFormat equivFormat = texMgr->getNativeFormat (TEX_TYPE_2D, desiredFormat, TU_RENDERTARGET);
-            LogManager::getSingleton ().logMessage (
-                    "Caelum::DepthRenderer: RenderSystem supports " +
-                    PixelUtil::getFormatName (equivFormat) +
-                    " instead of " +
-                    PixelUtil::getFormatName (desiredFormat));
-            requestFormat = equivFormat;
-        } else {
-            CAELUM_THROW_UNSUPPORTED_EXCEPTION (
-                    PixelUtil::getFormatName(desiredFormat) + " or equivalent not supported",
-                    "DepthRenderer");
-        }
-
-        if (texMgr->isHardwareFilteringSupported (TEX_TYPE_2D, requestFormat, TU_RENDERTARGET)) {
-            LogManager::getSingleton ().logMessage (
-                    "Caelum::DepthRenderer: RenderSystem supports hardware filtering for " +
-                    PixelUtil::getFormatName (requestFormat));
-        } else {
-            LogManager::getSingleton ().logMessage (
-                    "Caelum::DepthRenderer: RenderSystem does not support hardware filtering for " +
-                    PixelUtil::getFormatName (requestFormat));
-        }
-
-        // Create depth texture.
-        // This depends on the size of the viewport.
-        mDepthRenderTexture = texMgr->createManual(
-                "Caelum/DepthComposer/" + uniqueId + "/DepthTexture",
-                Caelum::RESOURCE_GROUP_NAME,
-                TEX_TYPE_2D,
-                width, height, 1,
-                0,
-                requestFormat,
-                TU_RENDERTARGET,
-                0);
-
-        assert(getDepthRenderTarget());
-
-        // Should be the same format
-        LogManager::getSingleton().logMessage (
-                "Caelum::DepthRenderer: Created depth render texture"
-                " actual format " + PixelUtil::getFormatName (getDepthRenderTexture()->getFormat ()) +
-                " desired format " + PixelUtil::getFormatName (getDepthRenderTexture()->getDesiredFormat ()));
-
-        // We do our updates by hand.
-        getDepthRenderTarget()->setAutoUpdated (false);
-
-        // Viewport for the depth rtt. Don't set camera here; it can mess Camera::getViewport();
-        mDepthRenderViewport = getDepthRenderTarget()->addViewport(0);
-        getDepthRenderViewport ()->setShadowsEnabled (false);
-        getDepthRenderViewport ()->setOverlaysEnabled (false);
-        getDepthRenderViewport ()->setClearEveryFrame (true);
-
-        // Depth buffer values range from 0 to 1 in both OpenGL and Directx; unless depth ranges are used.
-        // Clear to the maximum value.
-        getDepthRenderViewport ()->setBackgroundColour (Ogre::ColourValue (1, 1, 1, 1));
-    }
-
-    DepthRenderer::~DepthRenderer()
-    {
-        TextureManager* texMgr = TextureManager::getSingletonPtr();
-
-        // Destroy render texture.
-        if (!mDepthRenderTexture.isNull ()) {
-            texMgr->remove (mDepthRenderTexture->getHandle ());
-            mDepthRenderTexture.setNull ();
-        }
-    }
-
-    void DepthRenderer::update ()
-    {
-        Camera* camera = getMasterViewport ()->getCamera ();
-        Viewport* oldCameraViewport = camera->getViewport ();
-        SceneManager *sceneManager = camera->getSceneManager ();
-
-        assert (oldCameraViewport == getMasterViewport ());
-        assert (getDepthRenderViewport ()->getActualWidth () == getMasterViewport()->getActualWidth ());
-        assert (getDepthRenderViewport ()->getActualHeight () == getMasterViewport()->getActualHeight ());
-
-        getDepthRenderViewport ()->setVisibilityMask (mViewportVisibilityMask);
-        getDepthRenderViewport ()->setCamera (camera);
-        if (this->getUseCustomDepthScheme ()) {
-            getDepthRenderViewport ()->setMaterialScheme (this->getCustomDepthSchemeName ());
-        }
-
-        // Restore old listener after we're done.
-        // Hopefully this will not break horribly.
-        RenderQueue::RenderableListener* oldListener = sceneManager->getRenderQueue ()->getRenderableListener();
-        if (oldListener) {
-            //LogManager::getSingleton ().logMessage (
-            //        "Caelum: Found another render queue listener. This could be bad.");
-        }
-        sceneManager->getRenderQueue ()->setRenderableListener (this);
-
-        mDepthRenderingNow = true;
-        //LogManager::getSingleton ().logMessage ("Caelum: Begin depth rendering");
-        getDepthRenderTarget ()->update ();
-        //LogManager::getSingleton ().logMessage ("Caelum: End depth rendering");
-        mDepthRenderingNow = false;
-
-        sceneManager->getRenderQueue ()->setRenderableListener (oldListener);
-        oldListener = 0;
-
-        // Restore the camera's viewport. Ogre compositors do the same thing.
-        camera->_notifyViewport (oldCameraViewport);
-    }
-
-#if OGRE_VERSION < 0x00010600
-    bool DepthRenderer::renderableQueued(
-                Ogre::Renderable* rend,
-                Ogre::uint8 groupId,
-                Ogre::ushort priority, 
-                Ogre::Technique** ppTech)
-#else
-    bool DepthRenderer::renderableQueued(
-                Ogre::Renderable* rend,
-                Ogre::uint8 groupId,
-                Ogre::ushort priority, 
-                Ogre::Technique** ppTech,
-                Ogre::RenderQueue* pQueue)
-#endif // OGRE_VERSION
-    {
-        assert (mDepthRenderingNow);
-
-        /*
-        LogManager::getSingleton ().logMessage (
-                "Caelum: Renderable queued"
-                " group " + StringConverter::toString (groupId) + 
-                " priority " + StringConverter::toString (priority));
-        */
-        if (groupId < mMinRenderGroupId || groupId > mMaxRenderGroupId) {
-            return false;
-        }
-
-        if (this->getUseCustomDepthScheme () && (*ppTech)->getSchemeName () == this->getCustomDepthSchemeName ()) {
-            /*
-            LogManager::getSingleton().getDefaultLog()->logMessage (
-                    "Custom scheme with tech " + (*ppTech)->getName () + 
-                    " passCount " + StringConverter::toString ((*ppTech)->getNumPasses ()) +
-                    " vp " + (*ppTech)->getPass (0)->getVertexProgramName () + 
-                    " fp " + (*ppTech)->getPass (0)->getFragmentProgramName ());
-             */
-            return true;
-        }
-
-        // Get depth material
-        Material* depthMaterial = getDepthRenderMaterial ();
-        Technique* tech = depthMaterial->getBestTechnique ();
-
-        // Replace ALL techniques.
-        *ppTech = tech;
-        return true;
-    }
-
-    void DepthRenderer::setRenderGroupRangeFilter (int minGroup, int maxGroup)
-    {
-        mMinRenderGroupId = minGroup;
-        mMaxRenderGroupId = maxGroup;
-    }
-
-    void DepthRenderer::disableRenderGroupRangeFilter()
-    {
-        setRenderGroupRangeFilter(Ogre::RENDER_QUEUE_BACKGROUND, Ogre::RENDER_QUEUE_MAX);
-    }
-}
diff --git a/extern/caelum/src/FastGpuParamRef.cpp b/extern/caelum/src/FastGpuParamRef.cpp
deleted file mode 100644
index 156d7bd545..0000000000
--- a/extern/caelum/src/FastGpuParamRef.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2009 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "FastGpuParamRef.h"
-
-using namespace Ogre;
-
-namespace Caelum
-{
-    FastGpuParamRef::FastGpuParamRef(Ogre::GpuProgramParametersSharedPtr paramsPtr, const Ogre::String& name)
-    {
-        this->bind(paramsPtr, name);
-    }
-
-    void FastGpuParamRef::bind(
-            Ogre::GpuProgramParametersSharedPtr params,
-            const Ogre::String& name,
-            bool throwIfNotFound/* = false*/)
-    {
-        assert(!params.isNull());
-        #if CAELUM_DEBUG_PARAM_REF
-            mParams = params;
-        #endif
-        const GpuConstantDefinition* def = params->_findNamedConstantDefinition(name, throwIfNotFound);
-        if (def) {
-            mPhysicalIndex = def->physicalIndex;
-            assert(this->isBound());
-        } else {
-            mPhysicalIndex = InvalidPhysicalIndex;
-            assert(!this->isBound());
-        }
-    }
-
-    void FastGpuParamRef::unbind() {
-        #if CAELUM_DEBUG_PARAM_REF
-            mParams.setNull();
-        #endif
-        mPhysicalIndex = InvalidPhysicalIndex;
-        assert(!this->isBound());
-    }
-}
diff --git a/extern/caelum/src/FlatCloudLayer.cpp b/extern/caelum/src/FlatCloudLayer.cpp
deleted file mode 100644
index 8bca4d6dab..0000000000
--- a/extern/caelum/src/FlatCloudLayer.cpp
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "FlatCloudLayer.h"
-#include "CaelumExceptions.h"
-#include "InternalUtilities.h"
-
-namespace Caelum
-{
-	FlatCloudLayer::FlatCloudLayer(
-            Ogre::SceneManager *sceneMgr,
-			Ogre::SceneNode *cloudRoot)
-	{
-        Ogre::String uniqueSuffix = InternalUtilities::pointerToString(this);
-
-		// Clone material
-		mMaterial.reset(InternalUtilities::checkLoadMaterialClone ("CaelumLayeredClouds", "Caelum/FlatCloudLayer/Material" + uniqueSuffix));
-
-        mParams.setup(
-                mMaterial->getTechnique(0)->getPass(0)->getVertexProgramParameters(),
-                mMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters());
-
-        // Create the scene node.
-		mSceneMgr = sceneMgr;
-		mNode.reset(cloudRoot->createChildSceneNode());
-		mNode->setPosition(Ogre::Vector3(0, 0, 0));
-
-        // Noise texture names are fixed.
-        mNoiseTextureNames.clear();
-        mNoiseTextureNames.push_back("noise1.dds");
-        mNoiseTextureNames.push_back("noise2.dds");
-        mNoiseTextureNames.push_back("noise3.dds");
-        mNoiseTextureNames.push_back("noise4.dds");
-
-        // Invalid; will reset on first opportunity.
-        mCurrentTextureIndex = -1;
-
-        // By default height is 0; the user is expected to change this.
-		setHeight(0);		
-
-        // Reset parameters. This is relied upon to initialize most fields.
-        this->reset();
-
-        // Ensure geometry; don't wait for first update.
-        this->_ensureGeometry();
-	}
-	
-	FlatCloudLayer::~FlatCloudLayer()
-    {
-		mSceneMgr = 0;
-
-        // Rely on PrivatePtr for everything interesting.
-	}	
-
-    void FlatCloudLayer::_invalidateGeometry () {
-        mMeshDirty = true;
-    }
-
-    void FlatCloudLayer::_ensureGeometry ()
-    {
-        if (!mMeshDirty) {
-            return;
-        }
-
-        // Generate unique names based on pointer.
-        Ogre::String uniqueId = Ogre::StringConverter::toString((size_t)this);
-        Ogre::String planeMeshName = "Caelum/FlatCloudLayer/Plane/" + uniqueId;
-        Ogre::String entityName = "Caelum/FlatCloudLayer/Entity/" + uniqueId;
-
-        // Cleanup first. Entity references mesh so it must be destroyed first.
-        mEntity.reset();
-        mMesh.reset();
-
-        /*
-        Ogre::LogManager::getSingleton().logMessage(
-                "Creating cloud layer mesh " +
-                Ogre::StringConverter::toString(mMeshWidthSegments) + "x" +
-                Ogre::StringConverter::toString(mMeshHeightSegments) + " segments");
-         */
-
-        // Recreate mesh.
-        Ogre::Plane meshPlane(
-                Ogre::Vector3(1, 1, 0),
-                Ogre::Vector3(1, 1, 1),
-                Ogre::Vector3(0, 1, 1));
-		mMesh.reset(Ogre::MeshManager::getSingleton().createPlane(
-                planeMeshName, Caelum::RESOURCE_GROUP_NAME, meshPlane,
-                mMeshWidth, mMeshHeight,
-			    mMeshWidthSegments, mMeshHeightSegments,
-                false, 1,
-                1.0f, 1.0f,
-			    Ogre::Vector3::UNIT_X));
-
-        // Recreate entity.
-		mEntity.reset(mSceneMgr->createEntity(entityName, mMesh->getName()));
-		mEntity->setMaterialName(mMaterial->getName());
-
-        // Reattach entity.
-		mNode->attachObject(mEntity.get());
-
-        // Mark done.
-        mMeshDirty = false;
-    }
-
-    void FlatCloudLayer::setMeshParameters (
-            Real meshWidth, Real meshHeight,
-            int meshWidthSegments, int meshHeightSegments)
-    {
-        bool invalidate =
-                (mMeshWidthSegments != meshWidthSegments) ||
-                (mMeshHeightSegments != meshHeightSegments) ||
-                (abs(mMeshWidth - meshWidth) > 0.001) ||
-                (abs(mMeshHeight - meshHeight) > 0.001);
-        mMeshWidth = meshWidth;
-        mMeshHeight = meshHeight;
-        mMeshWidthSegments = meshWidthSegments;
-        mMeshHeightSegments = meshHeightSegments;
-        if (invalidate) {
-            _invalidateGeometry();
-        }
-    }
-
-	void FlatCloudLayer::reset()
-    {
-        _invalidateGeometry ();
-        setMeshParameters(10000000, 10000000, 10, 10);
-
-        assert (mCloudCoverLookup.get() == 0);
-        setCloudCoverLookup ("CloudCoverLookup.png");
-		setCloudCover (0.3);
-        setCloudCoverVisibilityThreshold (0.001);
-
-		setCloudMassOffset (Ogre::Vector2(0, 0));
-		setCloudDetailOffset (Ogre::Vector2(0, 0));
-		setCloudBlendTime (3600 * 24);
-		setCloudBlendPos (0.5);
-
-		setCloudSpeed (Ogre::Vector2(0.000005, -0.000009));
-
-		setCloudUVFactor (150);
-		setHeightRedFactor (100000);
-
-        setFadeDistances (10000, 140000);
-        setFadeDistMeasurementVector (Ogre::Vector3(0, 1, 1));
-
-        setSunDirection (Ogre::Vector3::UNIT_Y);
-        setFogColour (Ogre::ColourValue::Black);
-        setSunLightColour (Ogre::ColourValue::White);
-        setSunSphereColour (Ogre::ColourValue::White);
-    }
-
-	void FlatCloudLayer::update (
-            Ogre::Real timePassed,
-			const Ogre::Vector3 &sunDirection,
-			const Ogre::ColourValue &sunLightColour,
-			const Ogre::ColourValue &fogColour,
-			const Ogre::ColourValue &sunSphereColour)
-	{
-        // Advance animation
-        advanceAnimation (timePassed);
-
-	    // Set parameters.
-		setSunDirection (sunDirection);
-		setSunLightColour (sunLightColour);
-		setSunSphereColour (sunSphereColour);
-		setFogColour (fogColour);
-
-        this->_ensureGeometry();
-
-        this->_updateVisibilityThreshold();
-	}	
-
-	void FlatCloudLayer::_updateVisibilityThreshold ()
-    {
-        if (!mEntity.isNull()) {
-            mEntity->setVisible (getCloudCover () > this->getCloudCoverVisibilityThreshold ());
-        }
-    }
-
-	void FlatCloudLayer::advanceAnimation (Ogre::Real timePassed)
-    {
-	    // Move clouds.
-		setCloudMassOffset(mCloudMassOffset + timePassed * mCloudSpeed);
-		setCloudDetailOffset(mCloudDetailOffset - timePassed * mCloudSpeed);
-
-		// Animate cloud blending.
-        setCloudBlendPos (getCloudBlendPos () + timePassed / mCloudBlendTime);
-    }
-
-    void FlatCloudLayer::Params::setup(Ogre::GpuProgramParametersSharedPtr vpParams, Ogre::GpuProgramParametersSharedPtr fpParams)
-    {
-        this->vpParams = vpParams;
-        this->fpParams = fpParams;
-        cloudCoverageThreshold.bind(fpParams, "cloudCoverageThreshold");
-        cloudMassOffset.bind(fpParams, "cloudMassOffset");
-        cloudDetailOffset.bind(fpParams, "cloudDetailOffset");
-        cloudMassBlend.bind(fpParams, "cloudMassBlend");
-        vpSunDirection.bind(vpParams, "sunDirection");
-        fpSunDirection.bind(fpParams, "sunDirection");
-        sunLightColour.bind(fpParams, "sunLightColour");
-        sunSphereColour.bind(fpParams, "sunSphereColour");
-        fogColour.bind(fpParams, "fogColour");
-        layerHeight.bind(fpParams, "layerHeight");
-        cloudUVFactor.bind(fpParams, "cloudUVFactor");
-        heightRedFactor.bind(fpParams, "heightRedFactor");
-        nearFadeDist.bind(fpParams, "nearFadeDist");
-        farFadeDist.bind(fpParams, "farFadeDist");
-        fadeDistMeasurementVector.bind(fpParams, "fadeDistMeasurementVector");
-    }
-
-	void FlatCloudLayer::setCloudCoverLookup (const Ogre::String& fileName) {
-        mCloudCoverLookup.reset(0);
-        mCloudCoverLookup.reset(new Ogre::Image());
-        mCloudCoverLookup->load(fileName, RESOURCE_GROUP_NAME);
-
-        mCloudCoverLookupFileName = fileName;
-    }
-
-    void FlatCloudLayer::disableCloudCoverLookup () {
-        mCloudCoverLookup.reset (0);
-        mCloudCoverLookupFileName.clear ();
-    }
-
-    const Ogre::String FlatCloudLayer::getCloudCoverLookupFileName () const {
-        return mCloudCoverLookupFileName;
-    }
-
-	void FlatCloudLayer::setCloudCoverVisibilityThreshold(const Ogre::Real value) {
-        mCloudCoverVisibilityThreshold = value;
-        _updateVisibilityThreshold();
-    }
-
-	void FlatCloudLayer::setCloudCover(const Ogre::Real cloudCover) {
-        mCloudCover = cloudCover;
-		float cloudCoverageThreshold = 0;
-        if (mCloudCoverLookup.get() != 0) {
-			cloudCoverageThreshold = InternalUtilities::getInterpolatedColour(cloudCover, 1, mCloudCoverLookup.get(), false).r;
-        } else {
-            cloudCoverageThreshold = 1 - cloudCover;   
-        }
-		mParams.cloudCoverageThreshold.set(mParams.fpParams, cloudCoverageThreshold);
-        _updateVisibilityThreshold();
-	}
-
-	void FlatCloudLayer::setCloudMassOffset(const Ogre::Vector2 &cloudMassOffset) {
-		mCloudMassOffset = cloudMassOffset;		
-		mParams.cloudMassOffset.set(mParams.fpParams, Ogre::Vector3(cloudMassOffset.x,cloudMassOffset.y,0));		
-	}
-
-	void FlatCloudLayer::setCloudDetailOffset(const Ogre::Vector2 &cloudDetailOffset) {
-		mCloudDetailOffset = cloudDetailOffset;
-		mParams.cloudDetailOffset.set(mParams.fpParams, Ogre::Vector3(cloudDetailOffset.x,cloudDetailOffset.y,0));		
-	}
-
-	void FlatCloudLayer::setCloudBlendTime(const Ogre::Real value) {
-		mCloudBlendTime = value;
-	}
-
-    Ogre::Real FlatCloudLayer::getCloudBlendTime () const {
-        return mCloudBlendTime;
-    }
-
-    void FlatCloudLayer::setCloudBlendPos (const Ogre::Real value)
-    {
-        mCloudBlendPos = value;
-        int textureCount = static_cast<int>(mNoiseTextureNames.size());
-
-        // Convert to int and bring to [0, textureCount)
-        int currentTextureIndex = static_cast<int>(floor(mCloudBlendPos));
-        currentTextureIndex = ((currentTextureIndex % textureCount) + textureCount) % textureCount;
-        assert(0 <= currentTextureIndex);
-        assert(currentTextureIndex < textureCount);
-
-        // Check if we have to change textures.
-        if (currentTextureIndex != mCurrentTextureIndex) {
-            String texture1 = mNoiseTextureNames[currentTextureIndex];
-            String texture2 = mNoiseTextureNames[(currentTextureIndex + 1) % textureCount];
-            //Ogre::LogManager::getSingleton ().logMessage (
-            //        "Caelum: Switching cloud layer textures to " + texture1 + " and " + texture2);
-            Ogre::Pass* pass = mMaterial->getBestTechnique()->getPass(0);
-            pass->getTextureUnitState(0)->setTextureName(texture1);
-            pass->getTextureUnitState(1)->setTextureName(texture2);
-            mCurrentTextureIndex = currentTextureIndex;
-        }
-
-        Ogre::Real cloudMassBlend = fmod(mCloudBlendPos, 1);
-		mParams.cloudMassBlend.set(mParams.fpParams, cloudMassBlend);
-    }
-
-    Ogre::Real FlatCloudLayer::getCloudBlendPos () const {
-        return mCloudBlendPos;
-    }
-
-	void FlatCloudLayer::setCloudSpeed (const Ogre::Vector2 &cloudSpeed) {
-		mCloudSpeed = cloudSpeed;
-	}
-
-	void FlatCloudLayer::setSunDirection (const Ogre::Vector3 &sunDirection) {
-        mSunDirection = sunDirection;
-		mParams.vpSunDirection.set(mParams.vpParams, sunDirection);
-		mParams.fpSunDirection.set(mParams.fpParams, sunDirection);
-	}
-
-	void FlatCloudLayer::setSunLightColour (const Ogre::ColourValue &sunLightColour) {
-		mParams.sunLightColour.set(mParams.fpParams, mSunLightColour = sunLightColour);
-	}
-
-	void FlatCloudLayer::setSunSphereColour (const Ogre::ColourValue &sunSphereColour) {
-		mParams.sunSphereColour.set(mParams.fpParams, mSunSphereColour = sunSphereColour);
-	}
-
-	void FlatCloudLayer::setFogColour (const Ogre::ColourValue &fogColour) {
-		mParams.fogColour.set(mParams.fpParams, mFogColour = fogColour);
-	}
-
-	const Ogre::Vector3 FlatCloudLayer::getSunDirection () const {
-		return mSunDirection;
-	}
-
-	const Ogre::ColourValue FlatCloudLayer::getSunLightColour () const {
-		return mSunLightColour;
-	}
-
-	const Ogre::ColourValue FlatCloudLayer::getSunSphereColour () const {
-		return mSunSphereColour;
-	}
-
-    const Ogre::ColourValue FlatCloudLayer::getFogColour () const {
-        return mFogColour;
-    }
-
-	void FlatCloudLayer::setHeight(Ogre::Real height) {
-		mNode->setPosition(Ogre::Vector3(0, height, 0));
-		mHeight = height;
-		mParams.layerHeight.set(mParams.fpParams, mHeight);
-	}
-
-    Ogre::Real FlatCloudLayer::getHeight() const {
-		return mHeight;
-	}
-
-    void FlatCloudLayer::setCloudUVFactor (const Ogre::Real value) {
-		mParams.cloudUVFactor.set(mParams.fpParams, mCloudUVFactor = value);
-    }
-
-    void FlatCloudLayer::setHeightRedFactor (const Ogre::Real value) {
-		mParams.heightRedFactor.set(mParams.fpParams, mHeightRedFactor = value);
-    }
-
-    void FlatCloudLayer::setFadeDistances (const Ogre::Real nearValue, const Ogre::Real farValue) {
-        setNearFadeDist (nearValue);
-        setFarFadeDist (farValue);
-    }
-
-    void FlatCloudLayer::setNearFadeDist (const Ogre::Real value) {
-		mParams.nearFadeDist.set(mParams.fpParams, mNearFadeDist = value);
-    }
-
-    void FlatCloudLayer::setFarFadeDist (const Ogre::Real value) {
-		mParams.farFadeDist.set(mParams.fpParams, mFarFadeDist = value);
-    }
-
-    void FlatCloudLayer::setFadeDistMeasurementVector (const Ogre::Vector3& value) {
-		mParams.fadeDistMeasurementVector.set(mParams.fpParams, mFadeDistMeasurementVector = value);
-    }
-}
diff --git a/extern/caelum/src/GroundFog.cpp b/extern/caelum/src/GroundFog.cpp
deleted file mode 100644
index 2c57081b85..0000000000
--- a/extern/caelum/src/GroundFog.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "GroundFog.h"
-#include "CaelumExceptions.h"
-#include "InternalUtilities.h"
-
-namespace Caelum
-{
-	const Ogre::String GroundFog::DEFAULT_PASS_NAME = "CaelumGroundFog";
-
-	GroundFog::GroundFog(
-			Ogre::SceneManager *sceneMgr,
-			Ogre::SceneNode *caelumRootNode,
-			const Ogre::String &domeMaterialName,
-			const Ogre::String &domeEntityName):
-			mScene(sceneMgr)
-	{
-        Ogre::String uniqueSuffix = InternalUtilities::pointerToString (this);
-
-		mDomeMaterial.reset(InternalUtilities::checkLoadMaterialClone (domeMaterialName, domeMaterialName + uniqueSuffix));
-        mDomeParams.setup(mDomeMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters());
-
-		// Create dome entity, using a prefab sphere.
-        // The prefab sphere has a radius of 50 units.
-        // If this changes in future version of ogre this might break.
-        mDomeEntity.reset (mScene->createEntity (domeEntityName, Ogre::SceneManager::PT_SPHERE));
-        mDomeEntity->setMaterialName (mDomeMaterial->getName ());
-        mDomeEntity->setCastShadows (false);
-        mDomeEntity->setRenderQueueGroup (CAELUM_RENDER_QUEUE_GROUND_FOG);
-		sceneMgr->getRenderQueue()->getQueueGroup(CAELUM_RENDER_QUEUE_GROUND_FOG)->setShadowsEnabled(false);
-		
-        // Create dome node
-		mDomeNode.reset (caelumRootNode->createChildSceneNode ());
-		mDomeNode->attachObject (mDomeEntity.get());
-		
-		// Initialize default fog parameters
-		mDensity = 0.1;
-		mVerticalDecay = 0.2;
-		mGroundLevel = 5;
-		mFogColour = Ogre::ColourValue::Black;
-
-        forceUpdate();
-	}
-
-	GroundFog::~GroundFog() {
-        // Disable passes.
-        setDensity(0);
-	}
-
-	GroundFog::PassSet& GroundFog::getPasses() {
-		return mPasses;
-	}
-
-	const GroundFog::PassSet& GroundFog::getPasses() const {
-		return mPasses;
-	}
-
-	void GroundFog::findFogPassesByName (const Ogre::String& passName) {
-		Ogre::MaterialManager *matManager = Ogre::MaterialManager::getSingletonPtr();
-		Ogre::MaterialManager::ResourceMapIterator matIt = matManager->getResourceIterator();
-		while (matIt.hasMoreElements()) {
-			Ogre::MaterialPtr mat = matIt.getNext();
-			Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
-			while (techIt.hasMoreElements()) {
-				Ogre::Technique *tech = techIt.getNext();
-				Ogre::Technique::PassIterator passIt = tech->getPassIterator();
-				while (passIt.hasMoreElements()) {
-					Ogre::Pass *pass = passIt.getNext();
-					if (pass->getName() == passName) {
-						mPasses.insert(pass);
-					}
-				}
-			}
-		}
-		forceUpdate();
-	}
-
-	void GroundFog::setDensity (Ogre::Real density) {
-		if (Ogre::Math::Abs(mDensity - density) > 0.000001) {
-            for (PassFogParamsVector::const_iterator it = mPassFogParams.begin(), end = mPassFogParams.end(); it != end; ++it) {
-			    it->fogDensity.set(it->fpParams, density);
-			}
-			mDensity = density;
-		}
-		updateSkyFogging();
-	}
-
-	Ogre::Real GroundFog::getDensity () const {
-		return mDensity;
-	}
-
-	void GroundFog::setColour (const Ogre::ColourValue &colour) {
-        bool different = 
-                Ogre::Math::Abs(mFogColour.r - colour.r) > 0.001 ||
-                Ogre::Math::Abs(mFogColour.g - colour.g) > 0.001 ||
-                Ogre::Math::Abs(mFogColour.b - colour.b) > 0.001 ||
-                Ogre::Math::Abs(mFogColour.a - colour.a) > 0.001;
-        if (different) {
-            for (PassFogParamsVector::const_iterator it = mPassFogParams.begin(), end = mPassFogParams.end(); it != end; ++it) {
-			    it->fogColour.set(it->fpParams, colour);
-		    }
-		    mFogColour = colour;
-        }
-		updateSkyFogging();
-	}
-
-	const Ogre::ColourValue GroundFog::getColour () const {
-        return mFogColour;
-	}
-
-	void GroundFog::setVerticalDecay (Ogre::Real verticalDecay) {
-		if (Ogre::Math::Abs(mVerticalDecay - verticalDecay) > 0.000001) {
-            for (PassFogParamsVector::const_iterator it = mPassFogParams.begin(), end = mPassFogParams.end(); it != end; ++it) {
-			    it->fogVerticalDecay.set(it->fpParams, verticalDecay);
-			}
-			mVerticalDecay = verticalDecay;
-		}
-		updateSkyFogging();
-	}
-
-	Ogre::Real GroundFog::getVerticalDecay () const {
-		return mVerticalDecay;
-	}
-
-	void GroundFog::setGroundLevel (Ogre::Real groundLevel) {
-		if (Ogre::Math::Abs(mGroundLevel - groundLevel) > 0.000001) {
-            for (PassFogParamsVector::const_iterator it = mPassFogParams.begin(), end = mPassFogParams.end(); it != end; ++it) {
-			    it->fogGroundLevel.set(it->fpParams, groundLevel);
-			}
-			mGroundLevel = groundLevel;
-		}
-		updateSkyFogging();
-	}
-
-	Ogre::Real GroundFog::getGroundLevel () const {
-		return mGroundLevel;
-	}
-
-	void GroundFog::updateSkyFogging() {
-        mDomeParams.fogDensity.set(mDomeParams.fpParams, mDensity);
-		mDomeParams.fogVerticalDecay.set(mDomeParams.fpParams, mVerticalDecay);
-		mDomeParams.fogGroundLevel.set(mDomeParams.fpParams, mGroundLevel);
-		mDomeParams.fogColour.set(mDomeParams.fpParams, mFogColour);
-	}
-
-	void GroundFog::forceUpdate ()
-    {
-        updatePassFogParams();
-        for (PassFogParamsVector::const_iterator it = mPassFogParams.begin(), end = mPassFogParams.end(); it != end; ++it) {
-            const PassFogParams& params = *it;
-            params.fogDensity.set(params.fpParams, mDensity);
-			params.fogVerticalDecay.set(params.fpParams, mVerticalDecay);
-			params.fogGroundLevel.set(params.fpParams, mGroundLevel);
-			params.fogColour.set(params.fpParams, mFogColour);
-		}
-		updateSkyFogging();
-	}
-
-	void GroundFog::updatePassFogParams ()
-    {
-        mPassFogParams.clear();
-        for (PassSet::const_iterator it = mPasses.begin(), end = mPasses.end(); it != end; ++it) {
-            mPassFogParams.push_back(PassFogParams((*it)->getFragmentProgramParameters()));
-        }
-        std::sort(mPassFogParams.begin(), mPassFogParams.end(), PassFogParams::lessThanByParams);
-        std::unique(mPassFogParams.begin(), mPassFogParams.end(), PassFogParams::equalByParams);
-    }
-
-    void GroundFog::FogParamsBase::setup(Ogre::GpuProgramParametersSharedPtr fpParams) {
-        this->fpParams = fpParams;
-        fogDensity.bind(fpParams, "fogDensity");
-		fogVerticalDecay.bind(fpParams, "fogVerticalDecay");
-		fogGroundLevel.bind(fpParams, "fogGroundLevel");
-		fogColour.bind(fpParams, "fogColour");
-    }
-
-    void GroundFog::DomeFogParams::setup(Ogre::GpuProgramParametersSharedPtr fpParams) {
-        FogParamsBase::setup(fpParams);
-		cameraHeight.bind(fpParams, "cameraHeight");
-    }
-
-	void GroundFog::notifyCameraChanged (Ogre::Camera *cam)
-	{
-        CameraBoundElement::notifyCameraChanged (cam);
-
-		// Send camera height to shader.
-        float cameraHeight = cam->getDerivedPosition().dotProduct(mDomeNode->_getDerivedOrientation() * Ogre::Vector3::UNIT_Y);
-        mDomeParams.cameraHeight.set(mDomeParams.fpParams, cameraHeight);
-    }
-
-    void GroundFog::setFarRadius (Ogre::Real radius)
-    {
-        CameraBoundElement::setFarRadius(radius);
-        // Adjust for radius 50.
-        mDomeNode->setScale(Ogre::Vector3::UNIT_SCALE * radius / 50.0);
-	}
-}
diff --git a/extern/caelum/src/ImageStarfield.cpp b/extern/caelum/src/ImageStarfield.cpp
deleted file mode 100644
index 502480bc31..0000000000
--- a/extern/caelum/src/ImageStarfield.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "ImageStarfield.h"
-#include "InternalUtilities.h"
-
-namespace Caelum
-{
-    const Ogre::String ImageStarfield::STARFIELD_DOME_NAME = "CaelumStarfieldDome";
-    const Ogre::String ImageStarfield::STARFIELD_MATERIAL_NAME = "CaelumStarfieldMaterial";
-    const Ogre::String ImageStarfield::DEFAULT_TEXTURE_NAME = "Starfield.jpg";
-
-    ImageStarfield::ImageStarfield
-    (
-        Ogre::SceneManager *sceneMgr,
-        Ogre::SceneNode *caelumRootNode,
-        const Ogre::String &textureName/* = DEFAULT_TEXUTRE_NAME*/
-    )
-    {
-        mInclination = Ogre::Degree (0);
-
-        String uniqueSuffix = "/" + InternalUtilities::pointerToString (this);
-
-        mStarfieldMaterial.reset (InternalUtilities::checkLoadMaterialClone (STARFIELD_MATERIAL_NAME, STARFIELD_MATERIAL_NAME + uniqueSuffix));
-        setTexture (textureName);
-
-        sceneMgr->getRenderQueue ()->getQueueGroup (CAELUM_RENDER_QUEUE_STARFIELD)->setShadowsEnabled (false);
-
-        InternalUtilities::generateSphericDome (STARFIELD_DOME_NAME, 32, InternalUtilities::DT_IMAGE_STARFIELD);
-
-        mEntity.reset(sceneMgr->createEntity ("Caelum/StarfieldDome" + uniqueSuffix, STARFIELD_DOME_NAME));
-        mEntity->setMaterialName (mStarfieldMaterial->getName());
-        mEntity->setRenderQueueGroup (CAELUM_RENDER_QUEUE_STARFIELD);
-        mEntity->setCastShadows (false);
-
-        mNode.reset (caelumRootNode->createChildSceneNode ());
-        mNode->attachObject (mEntity.get ());
-    }
-
-    ImageStarfield::~ImageStarfield ()
-    {
-    }
-
-    void ImageStarfield::notifyCameraChanged (Ogre::Camera *cam) {
-        CameraBoundElement::notifyCameraChanged (cam);
-    }
-
-    void ImageStarfield::setFarRadius (Ogre::Real radius) {
-        CameraBoundElement::setFarRadius(radius);
-        mNode->setScale (Ogre::Vector3::UNIT_SCALE * radius);
-    }
-
-    void ImageStarfield::setInclination (Ogre::Degree inc) {
-        mInclination = inc;
-    }
-
-    void ImageStarfield::update (const float time) {
-        Ogre::Quaternion orientation = Ogre::Quaternion::IDENTITY;
-        orientation = orientation * Ogre::Quaternion (Ogre::Radian (mInclination + Ogre::Degree (90)), Ogre::Vector3::UNIT_X);
-        orientation = orientation * Ogre::Quaternion (Ogre::Radian (-time * 2 * Ogre::Math::PI), Ogre::Vector3::UNIT_Y);
-
-        mNode->setOrientation (orientation);
-    }
-
-    void ImageStarfield::setTexture (const Ogre::String &mapName) {
-        // Update the starfield material
-        mStarfieldMaterial->getBestTechnique ()->getPass (0)->getTextureUnitState (0)->setTextureName (mapName);
-    }
-}
diff --git a/extern/caelum/src/InternalUtilities.cpp b/extern/caelum/src/InternalUtilities.cpp
deleted file mode 100644
index f70b0f2670..0000000000
--- a/extern/caelum/src/InternalUtilities.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "CaelumExceptions.h"
-#include "InternalUtilities.h"
-#include "PrivatePtr.h"
-
-namespace Caelum
-{
-    Ogre::ColourValue InternalUtilities::getInterpolatedColour (
-            float fx, float fy, Ogre::Image *img, bool wrapX)
-    {
-	    // Don't -> all the time, and avoid unsigned warnings
-        int imgWidth = static_cast<int>(img->getWidth ());
-        int imgHeight = static_cast<int>(img->getHeight ());
-
-	    // Calculate pixel y coord.
-        int py = Ogre::Math::IFloor(Ogre::Math::Abs (fy) * (imgHeight - 1));
-        // Snap to py image bounds.
-        py = std::max(0, std::min(py, imgHeight - 1));
-
-	    // Get the two closest pixels on x.
-        // px1 and px2 are the closest integer pixels to px.
-        float px = fx * (img->getWidth () - 1);
-	    int px1, px2;
-        px1 = Ogre::Math::IFloor(px);
-        px2 = Ogre::Math::ICeil(px);
-
-        if (wrapX) {
-            // Wrap x coords. The funny addition ensures that it does
-            // "the right thing" for negative values.
-            px1 = (px1 % imgWidth + imgWidth) % imgWidth;
-            px2 = (px2 % imgWidth + imgWidth) % imgWidth;
-        } else {
-            px1 = std::max(0, std::min(px1, imgWidth - 1));
-            px2 = std::max(0, std::min(px2, imgWidth - 1));
-        }
-
-	    // Calculate the interpolated pixel
-	    Ogre::ColourValue c1, c2, cf;
-        c1 = img->getColourAt (px1, py, 0);
-        c2 = img->getColourAt (px2, py, 0);
-
-        // Blend the two pixels together.
-        // diff is the weight between pixel 1 and pixel 2.
-        float diff = px - px1;
-	    cf = c1 * (1 - diff) + c2 * diff;
-
-	    return cf;
-    }
-
-    const Ogre::String InternalUtilities::pointerToString (void* pointer)
-    {
-        std::stringstream stream;
-		stream.width(2 * sizeof(void *));
-        stream.fill('0');
-        stream.unsetf(std::ios::dec);
-        stream.setf(std::ios::hex);
-        stream.setf(std::ios::uppercase);
-        stream << reinterpret_cast<ptrdiff_t>(pointer);
-        return stream.str();
-    }
-
-    Ogre::MaterialPtr InternalUtilities::checkLoadMaterialClone (
-            const Ogre::String& originalName,
-            const Ogre::String& cloneName)
-    {
-        Ogre::MaterialPtr scriptMaterial = Ogre::MaterialManager::getSingletonPtr()->getByName(originalName);
-        if (scriptMaterial.isNull()) {
-            CAELUM_THROW_UNSUPPORTED_EXCEPTION (
-                    "Can't find material \"" + originalName + "\"",
-                    "Caelum");
-        }
-
-        // Create clone
-        Caelum::PrivateMaterialPtr clonedMaterial (scriptMaterial->clone (cloneName));
-
-        // Test clone loads and there is at least on supported technique
-        clonedMaterial->load ();
-        if (clonedMaterial->getBestTechnique () == 0) {
-            CAELUM_THROW_UNSUPPORTED_EXCEPTION (
-                    "Can't load material \"" + originalName + "\": " + clonedMaterial->getUnsupportedTechniquesExplanation(), 
-                    "Caelum");
-        }
-
-        return clonedMaterial.release();
-    }
-
-    Ogre::CompositorPtr InternalUtilities::checkCompositorSupported (const Ogre::String& name)
-    {
-        Ogre::CompositorPtr comp = Ogre::CompositorManager::getSingletonPtr()->getByName(name);
-        if (comp.isNull()) {
-            CAELUM_THROW_UNSUPPORTED_EXCEPTION (
-                    "Can't find compositor \"" + name + "\"",
-                    "Caelum");
-        }
-
-        // Check the compositor is supported after loading.
-        comp->load ();
-        if (comp->getNumSupportedTechniques () == 0) {
-            CAELUM_THROW_UNSUPPORTED_EXCEPTION (
-                    "Can't load compositor \"" + name + "\"", 
-                    "Caelum");
-        }
-
-        return comp;
-    }
-
-    void InternalUtilities::generateSphericDome (const Ogre::String &name, int segments, DomeType type)
-    {
-        // Return now if already exists
-        if (Ogre::MeshManager::getSingleton ().resourceExists (name)) {
-            return;
-        }
-
-        Ogre::LogManager::getSingleton ().logMessage (
-                "Caelum: Creating " + name + " sphere mesh resource...");
-
-        // Use the mesh manager to create the mesh
-        Ogre::MeshPtr msh = Ogre::MeshManager::getSingleton ().createManual (name, RESOURCE_GROUP_NAME);
-        // Create a submesh
-        Ogre::SubMesh *sub = msh->createSubMesh ();
-
-        // Create the shared vertex data
-        Ogre::VertexData *vertexData = new Ogre::VertexData ();
-        msh->sharedVertexData = vertexData;
-
-        // Define the vertices' format
-        Ogre::VertexDeclaration *vertexDecl = vertexData->vertexDeclaration;
-        size_t currOffset = 0;
-        // Position
-        vertexDecl->addElement (0, currOffset, Ogre::VET_FLOAT3, Ogre::VES_POSITION);
-        currOffset += Ogre::VertexElement::getTypeSize (Ogre::VET_FLOAT3);
-        // Normal
-        vertexDecl->addElement (0, currOffset, Ogre::VET_FLOAT3, Ogre::VES_NORMAL);
-        currOffset += Ogre::VertexElement::getTypeSize (Ogre::VET_FLOAT3);
-        // Texture coordinates
-        vertexDecl->addElement (0, currOffset, Ogre::VET_FLOAT2, Ogre::VES_TEXTURE_COORDINATES, 0);
-        currOffset += Ogre::VertexElement::getTypeSize (Ogre::VET_FLOAT2);
-
-        // Allocate the vertex buffer
-        switch (type) {
-            case DT_SKY_DOME:
-                vertexData->vertexCount = segments * (segments - 1) + 2;
-                break;
-            case DT_IMAGE_STARFIELD:
-                vertexData->vertexCount = (segments + 1) * (segments + 1);
-                break;
-        };
-        Ogre::HardwareVertexBufferSharedPtr vBuf = Ogre::HardwareBufferManager::getSingleton ().createVertexBuffer (vertexDecl->getVertexSize (0), vertexData->vertexCount, Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
-        Ogre::VertexBufferBinding *binding = vertexData->vertexBufferBinding;
-        binding->setBinding (0, vBuf);
-
-        float *pVertex = static_cast<float *>(vBuf->lock (Ogre::HardwareBuffer::HBL_DISCARD));
-
-        // Allocate the index buffer
-        switch (type) {
-            case DT_SKY_DOME:
-                sub->indexData->indexCount = 2 * segments * (segments - 1) * 3;
-                break;
-            case DT_IMAGE_STARFIELD:
-                sub->indexData->indexCount = 2 * (segments - 1) * segments * 3;
-                break;
-        };
-        sub->indexData->indexBuffer = Ogre::HardwareBufferManager::getSingleton ().createIndexBuffer (Ogre::HardwareIndexBuffer::IT_16BIT, sub->indexData->indexCount, Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, false);
-        Ogre::HardwareIndexBufferSharedPtr iBuf = sub->indexData->indexBuffer;
-        unsigned short *pIndices = static_cast<unsigned short *>(iBuf->lock (Ogre::HardwareBuffer::HBL_DISCARD));
-
-        // Fill the buffers
-        switch (type) {
-            case DT_SKY_DOME:
-                fillGradientsDomeBuffers (pVertex, pIndices, segments);
-                break;
-            case DT_IMAGE_STARFIELD:
-                fillStarfieldDomeBuffers (pVertex, pIndices, segments);
-                break;
-        };
-
-        // Close the vertex buffer
-        vBuf->unlock ();
-
-        // Close the index buffer
-        iBuf->unlock ();
-
-        // Finishing it...
-        sub->useSharedVertices = true;
-        msh->_setBounds (Ogre::AxisAlignedBox (-1, -1, -1, 1, 1, 1), false);
-        msh->_setBoundingSphereRadius (1);
-        msh->load ();
-
-        Ogre::LogManager::getSingleton ().logMessage (
-                "Caelum: generateSphericDome DONE");
-    }
-
-    void InternalUtilities::fillGradientsDomeBuffers (float *pVertex, unsigned short *pIndices, int segments)
-    {
-        const float deltaLatitude = Ogre::Math::PI / (float )segments;
-        const float deltaLongitude = Ogre::Math::PI * 2.0 / (float )segments;
-
-        // Generate the rings
-        for (int i = 1; i < segments; i++) {
-            float r0 = Ogre::Math::Sin (Ogre::Radian (i * deltaLatitude));
-            float y0 = Ogre::Math::Cos (Ogre::Radian (i * deltaLatitude));
-
-            for (int j = 0; j < segments; j++) {
-                float x0 = r0 * Ogre::Math::Sin (Ogre::Radian (j * deltaLongitude));
-                float z0 = r0 * Ogre::Math::Cos (Ogre::Radian (j * deltaLongitude));
-
-                *pVertex++ = x0;
-                *pVertex++ = y0;
-                *pVertex++ = z0;
-
-                *pVertex++ = -x0;
-                *pVertex++ = -y0;
-                *pVertex++ = -z0;
-
-                *pVertex++ = 0;
-                *pVertex++ = 1 - y0;
-            }
-        }
-
-        // Generate the "north pole"
-        *pVertex++ = 0;	// Position
-        *pVertex++ = 1;
-        *pVertex++ = 0;
-        *pVertex++ = 0;	// Normal
-        *pVertex++ = -1;
-        *pVertex++ = 0;
-        *pVertex++ = 0;	// UV
-        *pVertex++ = 0;
-
-        // Generate the "south pole"
-        *pVertex++ = 0;	// Position
-        *pVertex++ = -1;
-        *pVertex++ = 0;
-        *pVertex++ = 0;	// Normal
-        *pVertex++ = 1;
-        *pVertex++ = 0;
-        *pVertex++ = 0;	// UV
-        *pVertex++ = 2;
-
-        // Generate the mid segments
-        for (int i = 0; i < segments - 2; i++) {
-            for (int j = 0; j < segments; j++) {
-                *pIndices++ = segments * i + j;
-                *pIndices++ = segments * i + (j + 1) % segments;
-                *pIndices++ = segments * (i + 1) + (j + 1) % segments;
-                *pIndices++ = segments * i + j;
-                *pIndices++ = segments * (i + 1) + (j + 1) % segments;
-                *pIndices++ = segments * (i + 1) + j;
-            }
-        }
-
-        // Generate the upper cap
-        for (int i = 0; i < segments; i++) {
-            *pIndices++ = segments * (segments - 1);
-            *pIndices++ = (i + 1) % segments;
-            *pIndices++ = i;
-        }
-
-        // Generate the lower cap
-        for (int i = 0; i < segments; i++) {
-            *pIndices++ = segments * (segments - 1) + 1;
-            *pIndices++ = segments * (segments - 2) + i;
-            *pIndices++ = segments * (segments - 2) + (i + 1) % segments;
-        }
-    }
-
-    void InternalUtilities::fillStarfieldDomeBuffers (float *pVertex, unsigned short *pIndices, int segments)
-    {
-        const float deltaLatitude = Ogre::Math::PI / (float )segments;
-        const float deltaLongitude = Ogre::Math::PI * 2.0 / (float )segments;
-
-        // Generate the rings
-        for (int i = 0; i <= segments; i++) {
-            float r0 = Ogre::Math::Sin (Ogre::Radian (i * deltaLatitude));
-            float y0 = Ogre::Math::Cos (Ogre::Radian (i * deltaLatitude));
-
-            for (int j = 0; j <= segments; j++) {
-                float x0 = r0 * Ogre::Math::Sin (Ogre::Radian (j * deltaLongitude));
-                float z0 = r0 * Ogre::Math::Cos (Ogre::Radian (j * deltaLongitude));
-
-                *pVertex++ = x0;
-                *pVertex++ = y0;
-                *pVertex++ = z0;
-
-                *pVertex++ = -x0;
-                *pVertex++ = -y0;
-                *pVertex++ = -z0;
-
-                *pVertex++ = (float )j / (float )segments;
-                *pVertex++ = 1 - (y0 * 0.5 + 0.5);
-            }
-        }
-
-        // Generate the mid segments
-        int vRowSize = segments + 1;
-        for (int i = 1; i < segments; i++) {
-            for (int j = 0; j < segments; j++) {
-                int baseIdx = vRowSize * i + j;
-                *pIndices++ = baseIdx;
-                *pIndices++ = baseIdx + 1;
-                *pIndices++ = baseIdx + vRowSize + 1;
-                *pIndices++ = baseIdx + 1;
-                *pIndices++ = baseIdx;
-                *pIndices++ = baseIdx - vRowSize;
-            }
-        }
-    }
-}
diff --git a/extern/caelum/src/Moon.cpp b/extern/caelum/src/Moon.cpp
deleted file mode 100644
index b69a821d5c..0000000000
--- a/extern/caelum/src/Moon.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "CaelumExceptions.h"
-#include "InternalUtilities.h"
-#include "Moon.h"
-#include <memory>
-
-namespace Caelum
-{
-    const Ogre::String Moon::MOON_MATERIAL_NAME = "Caelum/PhaseMoon";
-    const Ogre::String Moon::MOON_BACKGROUND_MATERIAL_NAME = "Caelum/MoonBackground";
-
-    Moon::Moon (
-		    Ogre::SceneManager *sceneMgr,
-		    Ogre::SceneNode *caelumRootNode, 
-		    const Ogre::String& moonTextureName,
-		    Ogre::Degree angularSize
-    ):
-		    BaseSkyLight(sceneMgr, caelumRootNode),
-		    mAngularSize(angularSize)
-    {
-        Ogre::String uniqueSuffix = "/" + InternalUtilities::pointerToString(this);
-
-        // Clone materials
-        mMoonMaterial.reset(InternalUtilities::checkLoadMaterialClone(MOON_MATERIAL_NAME, MOON_MATERIAL_NAME + uniqueSuffix));
-        mBackMaterial.reset(InternalUtilities::checkLoadMaterialClone(MOON_BACKGROUND_MATERIAL_NAME, MOON_BACKGROUND_MATERIAL_NAME + uniqueSuffix));
-
-        assert (!mMoonMaterial.isNull ());
-        assert (mMoonMaterial->getTechnique (0));
-        assert (mMoonMaterial->getTechnique (0)->getPass (0));
-        assert (mMoonMaterial->getTechnique (0)->getPass( 0)->hasFragmentProgram ());
-        mParams.setup(mMoonMaterial->getBestTechnique ()->getPass (0)->getFragmentProgramParameters ());
-
-        setMoonTexture(moonTextureName);
-
-	    mMoonBB.reset(sceneMgr->createBillboardSet("Caelum/Moon/MoonBB" + uniqueSuffix, 1));
-	    mMoonBB->setMaterialName (mMoonMaterial->getName());
-	    mMoonBB->setCastShadows (false);
-	    mMoonBB->setRenderQueueGroup (CAELUM_RENDER_QUEUE_MOON);
-	    mMoonBB->setDefaultDimensions (1.0f, 1.0f);
-	    mMoonBB->createBillboard (Ogre::Vector3::ZERO);
-
-	    mBackBB.reset(sceneMgr->createBillboardSet("Caelum/Moon/BackBB" + uniqueSuffix, 1));
-	    mBackBB->setMaterialName (mBackMaterial->getName());
-	    mBackBB->setCastShadows (false);
-	    mBackBB->setRenderQueueGroup (CAELUM_RENDER_QUEUE_MOON_BACKGROUND);
-	    mBackBB->setDefaultDimensions (1.0f, 1.0f);
-	    mBackBB->createBillboard (Ogre::Vector3::ZERO);
-
-	    mNode->attachObject (mMoonBB.get());
-	    mNode->attachObject (mBackBB.get());
-    }
-
-    Moon::~Moon () {
-    }
-
-    void Moon::setBodyColour (const Ogre::ColourValue &colour) {
-	    BaseSkyLight::setBodyColour(colour);
-
-	    // Set moon material colour.
-	    mMoonBB->getBillboard(0)->setColour(colour);
-    }
-
-    void Moon::setMoonTexture (const Ogre::String &textureName)
-    {
-	    // Update the moon material
-	    assert(mMoonMaterial->getBestTechnique ());
-	    assert(mMoonMaterial->getBestTechnique ()->getPass (0));
-	    assert(mMoonMaterial->getBestTechnique ()->getPass (0)->getTextureUnitState (0));
-	    mMoonMaterial->getBestTechnique ()->getPass (0)->getTextureUnitState (0)->setTextureName (textureName);
-	    mBackMaterial->getBestTechnique ()->getPass (0)->getTextureUnitState (0)->setTextureName (textureName);
-    }
-
-    void Moon::setMoonTextureAngularSize(const Ogre::Degree& moonTextureAngularSize){
-	    mAngularSize = moonTextureAngularSize;
-    }
-
-    void Moon::notifyCameraChanged (Ogre::Camera *cam) {
-        // This calls setFarRadius
-        BaseSkyLight::notifyCameraChanged(cam);
-
-        // Set moon position.
-        Ogre::Real moonDistance = mRadius - mRadius * Ogre::Math::Tan(mAngularSize);
-	    mNode->setPosition(-mDirection * moonDistance);
-
-        // Set moon scaling in [1.0 ~ 1.2] range
-        float factor = 1.2f - mBodyColour.b * 0.2f;
-        float scale = factor * moonDistance * Ogre::Math::Tan(mAngularSize);
-        mNode->setScale (Ogre::Vector3::UNIT_SCALE * scale);
-    }
-
-    void Moon::Params::setup(Ogre::GpuProgramParametersSharedPtr fpParams)
-    {
-        this->fpParams = fpParams;
-        this->phase.bind(fpParams, "phase");
-    }
-
-    void Moon::setPhase (Ogre::Real phase) {
-        mParams.phase.set(mParams.fpParams, phase);	
-    }
-
-    void Moon::setQueryFlags (uint flags) {
-        mMoonBB->setQueryFlags (flags);
-        mBackBB->setQueryFlags (flags);
-    }
-
-    uint Moon::getQueryFlags () const {
-        assert (mMoonBB->getQueryFlags () == mBackBB->getQueryFlags ());
-        return mMoonBB->getQueryFlags ();
-    }
-
-    void Moon::setVisibilityFlags (uint flags) {
-        mMoonBB->setVisibilityFlags (flags);
-        mBackBB->setVisibilityFlags (flags);
-    }
-
-    uint Moon::getVisibilityFlags () const {
-        assert (mMoonBB->getVisibilityFlags () == mBackBB->getVisibilityFlags ());
-        return mMoonBB->getVisibilityFlags ();
-    }
-}
diff --git a/extern/caelum/src/PointStarfield.cpp b/extern/caelum/src/PointStarfield.cpp
deleted file mode 100644
index 57aa8e95bf..0000000000
--- a/extern/caelum/src/PointStarfield.cpp
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "PointStarfield.h"
-#include "CaelumExceptions.h"
-#include "Astronomy.h"
-#include "InternalUtilities.h"
-
-using namespace Ogre;
-
-namespace Caelum
-{
-	const Ogre::String PointStarfield::STARFIELD_MATERIAL_NAME = "Caelum/StarPoint";
-    const Ogre::Degree PointStarfield::DEFAULT_OBSERVER_POSITION_REBUILD_DELTA = Ogre::Degree(0.1);
-
-	PointStarfield::PointStarfield (
-			Ogre::SceneManager *sceneMgr,
-			Ogre::SceneNode *caelumRootNode,
-			bool initWithCatalogue)
-	{
-		mMag0PixelSize = 16;
-		mMinPixelSize = 4;
-		mMaxPixelSize = 6;
-		mMagnitudeScale = Math::Pow(100, 0.2);
-		mObserverLatitude = 45;
-		mObserverLongitude = 0;
-        mObserverPositionRebuildDelta = DEFAULT_OBSERVER_POSITION_REBUILD_DELTA;
-
-        String uniqueSuffix = "/" + InternalUtilities::pointerToString(this);
-
-        // Load material.
-        mMaterial.reset(InternalUtilities::checkLoadMaterialClone(
-                    STARFIELD_MATERIAL_NAME,
-                    STARFIELD_MATERIAL_NAME + uniqueSuffix));
-
-        mParams.setup(mMaterial->getTechnique(0)->getPass(0)->getVertexProgramParameters());
-
-		// We use a separate data source.
-		Ogre::String objName = "Caelum/PointStarfield" + uniqueSuffix;
-        mManualObj.reset (sceneMgr->createManualObject (objName));
-        mManualObj->setDynamic(false);
-		mManualObj->setRenderQueueGroup (CAELUM_RENDER_QUEUE_STARFIELD);
-		sceneMgr->getRenderQueue()->getQueueGroup(CAELUM_RENDER_QUEUE_STARFIELD)->setShadowsEnabled (false);
-        mManualObj->setCastShadows(false);
-
-		mNode.reset (caelumRootNode->createChildSceneNode ());
-		mNode->attachObject (mManualObj.getPointer ());
-
-		if (initWithCatalogue) {
-			addBrightStarCatalogue ();
-		}
-	}
-
-	PointStarfield::~PointStarfield ()
-    {
-	}
-
-    void PointStarfield::notifyStarVectorChanged () {
-        invalidateGeometry ();
-    }
-
-    void PointStarfield::clearAllStars () {
-        mStars.clear();
-        notifyStarVectorChanged ();
-    }
-
-	Real randReal () {
-		return rand() / static_cast<float>(RAND_MAX);
-	}
-
-	Real randReal (Real min, Real max) {
-		Real f = randReal ();
-		return min * (1 - f) + max * f;
-	}
-
-	void PointStarfield::addRandomStars (int count)
-	{
-		for (int i = 0; i < count; ++i) {
-			// Generate a vector inside a sphere
-			Ogre::Vector3 pos;
-			do {
-				pos.x = randReal(-1, 1);
-				pos.y = randReal(-1, 1);
-				pos.z = randReal(-1, 1);
-			} while (pos.squaredLength () >= 1);
-
-			// Convert to rasc/decl angles.
-			LongReal rasc, decl, dist;
-			Astronomy::convertRectangularToSpherical(
-					pos.x, pos.y, pos.z,
-					rasc, decl, dist);
-
-			Star s;
-			s.RightAscension = Ogre::Degree (rasc);
-			s.Declination = Ogre::Degree (decl);
-			// This distribution is wrong.
-			s.Magnitude = 6 * pos.squaredLength () + 1.5;
-			mStars.push_back(s);
-		}
-		notifyStarVectorChanged ();
-	}
-
-	void PointStarfield::addStar (const BrightStarCatalogueEntry &entry) {
-		Star s;
-		s.RightAscension = Ogre::Degree(360 / 24.0f * (
-				Math::Abs(entry.rasc_hour) +
-				entry.rasc_min / 60.0f +
-				entry.rasc_sec / 3600.0f));
-		s.Declination = Ogre::Degree(Math::Sign(entry.decl_deg) * (
-				Math::Abs(entry.decl_deg) +
-				entry.decl_min / 60.0f +
-				entry.decl_sec / 3600.0f));
-		s.Magnitude = entry.magn;
-		mStars.push_back(s);
-
-        notifyStarVectorChanged ();
-	}
-
-	void PointStarfield::addBrightStarCatalogue (int count) {
-		assert(count >= 0);
-		if (count < BrightStarCatalogueSize) {
-			// Only sort if we don't add everything.
-			// It would be lovely if the catalogue was already sorted.
-			std::vector<std::pair<Real, int> > vec;
-			vec.reserve(BrightStarCatalogueSize);
-			for (int i = 0; i < BrightStarCatalogueSize; ++i) {
-				vec.push_back(std::make_pair(BrightStarCatalogue[i].magn, i));
-			}
-			sort(vec.begin(), vec.end());
-			for (int i = 0; i < count; ++i) {
-				addStar(BrightStarCatalogue[vec[i].second]);
-			}
-		} else {
-			assert(count == BrightStarCatalogueSize);
-			for (int i = 0; i < BrightStarCatalogueSize; ++i) {
-				addStar(BrightStarCatalogue[i]);
-			}
-		}
-        notifyStarVectorChanged ();
-	}
-
-	void PointStarfield::invalidateGeometry () {
-		mValidGeometry = false;
-	}
-
-	void PointStarfield::ensureGeometry ()
-	{
-		if (mValidGeometry) {
-			return;
-		}
-
-		//Ogre::LogManager::getSingleton ().logMessage ("Caelum: Recomputing starfield geometry.");
-
-        size_t starCount = mStars.size();
-
-        mManualObj->clear();
-        mManualObj->estimateVertexCount(6 * starCount);
-        mManualObj->begin(mMaterial->getName (), Ogre::RenderOperation::OT_TRIANGLE_LIST);
-        for (uint i = 0; i < starCount; ++i)
-        {
-            const Star& star = mStars[i];
-
-			// Determine position at J2000
-			LongReal azm, alt;
-			Astronomy::convertEquatorialToHorizontal(
-					Astronomy::J2000,
-					mObserverLatitude.valueDegrees(),
-					mObserverLongitude.valueDegrees(),
-					star.RightAscension.valueDegrees(), star.Declination.valueDegrees(),
-					azm, alt);
-
-    		Ogre::Vector3 pos;
-		    pos.z = -Math::Cos (Ogre::Degree(azm)) * Math::Cos (Ogre::Degree(alt));
-		    pos.x =  Math::Sin (Ogre::Degree(azm)) * Math::Cos (Ogre::Degree(alt));
-		    pos.y = -Math::Sin (Ogre::Degree(alt));
-
-            //mManualObj->colour (Ogre::ColourValue::White);
-            mManualObj->position (pos);
-            mManualObj->textureCoord (+1, -1, star.Magnitude);
-            mManualObj->position (pos);
-            mManualObj->textureCoord (+1, +1, star.Magnitude);
-            mManualObj->position (pos);
-            mManualObj->textureCoord (-1, -1, star.Magnitude);
-
-            mManualObj->position (pos);
-            mManualObj->textureCoord (-1, -1, star.Magnitude);
-            mManualObj->position (pos);
-            mManualObj->textureCoord (+1, +1, star.Magnitude);
-            mManualObj->position (pos);
-            mManualObj->textureCoord (-1, +1, star.Magnitude);
-        }
-        mManualObj->end();
-
-        // Set infinite bounds on the starfield.
-        AxisAlignedBox box;
-        box.setInfinite ();
-        mManualObj->setBoundingBox (box);
-
-		mValidGeometry = true;
-	}
-    
-    void PointStarfield::Params::setup(Ogre::GpuProgramParametersSharedPtr vpParams)
-    {
-        this->vpParams = vpParams;
-        this->mag_scale.bind(vpParams, "mag_scale");
-        this->mag0_size.bind(vpParams, "mag0_size");
-        this->min_size.bind(vpParams, "min_size");
-        this->max_size.bind(vpParams, "max_size");
-        this->aspect_ratio.bind(vpParams, "aspect_ratio");
-    }
-
-	void PointStarfield::notifyCameraChanged (Ogre::Camera *cam) {
-		CameraBoundElement::notifyCameraChanged (cam);
-
-        // Shader params are changed for every camera.
-        Pass* pass = mMaterial->getBestTechnique ()->getPass (0);
-        GpuProgramParametersSharedPtr fpParams = pass->getFragmentProgramParameters ();
-        GpuProgramParametersSharedPtr vpParams = pass->getVertexProgramParameters ();
-
-        int height = cam->getViewport ()-> getActualHeight ();
-        int width = cam->getViewport ()-> getActualWidth ();
-        Real pixFactor = 1.0f / width;
-        Real magScale = -Math::Log (mMagnitudeScale) / 2;
-        Real mag0Size = mMag0PixelSize * pixFactor;
-        Real minSize = mMinPixelSize * pixFactor;
-        Real maxSize = mMaxPixelSize * pixFactor;
-        Real aspectRatio = static_cast<Real>(width) / height;
-
-        // These params are relative to the size of the screen.
-        mParams.mag_scale.set(mParams.vpParams, magScale);
-        mParams.mag0_size.set(mParams.vpParams, mag0Size);
-        mParams.min_size.set(mParams.vpParams, minSize);
-        mParams.max_size.set(mParams.vpParams, maxSize);
-        mParams.aspect_ratio.set(mParams.vpParams, aspectRatio);
-	}
-
-	void PointStarfield::setFarRadius (Ogre::Real radius) {
-        CameraBoundElement::setFarRadius(radius);
-	    mNode->setScale (Ogre::Vector3::UNIT_SCALE * radius);
-	}
-
-	void PointStarfield::_update (const float time) {
-		// This is probably wrong.
-		Ogre::Quaternion orientation = Ogre::Quaternion::IDENTITY;
-		orientation = orientation * Ogre::Quaternion (Ogre::Radian (-mObserverLatitude + Ogre::Degree (90)), Ogre::Vector3::UNIT_X);
-		orientation = orientation * Ogre::Quaternion (Ogre::Radian (-time * 2 * Ogre::Math::PI), Ogre::Vector3::UNIT_Y);
-		mNode->setOrientation (orientation);
-        ensureGeometry ();
-	}
-
-	void PointStarfield::setObserverLatitude (Ogre::Degree value)
-    {
-		if (!Math::RealEqual (
-                mObserverLatitude.valueDegrees (),
-                value.valueDegrees (),
-                this->getObserverPositionRebuildDelta ().valueDegrees ()))
-        {
-			mObserverLatitude = value;
-			invalidateGeometry ();
-		}
-	}
-
-	void PointStarfield::setObserverLongitude (Ogre::Degree value)
-    {
-		if (!Math::RealEqual (
-                mObserverLongitude.valueDegrees (), 
-                value.valueDegrees (),
-                this->getObserverPositionRebuildDelta ().valueDegrees ()))
-        {
-			mObserverLongitude = value;
-			invalidateGeometry ();
-		}
-	}
-}
diff --git a/extern/caelum/src/PrecipitationController.cpp b/extern/caelum/src/PrecipitationController.cpp
deleted file mode 100644
index d0f9c47d66..0000000000
--- a/extern/caelum/src/PrecipitationController.cpp
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "PrecipitationController.h"
-#include "InternalUtilities.h"
-
-using namespace Ogre;
-
-namespace Caelum
-{
-	const String PrecipitationController::COMPOSITOR_NAME = "Caelum/PrecipitationCompositor";
-	const String PrecipitationController::MATERIAL_NAME =   "Caelum/PrecipitationMaterial";
-
-	const PrecipitationPresetParams PrecipitationPresets[] = {
-        { Ogre::ColourValue(0.8, 0.8, 0.8, 1), 0.95, "precipitation_drizzle.png" },
-        { Ogre::ColourValue(0.8, 0.8, 0.8, 1), 0.85, "precipitation_rain.png" },
-        { Ogre::ColourValue(0.8, 0.8, 0.8, 1), 0.12, "precipitation_snow.png" },
-        { Ogre::ColourValue(0.8, 0.8, 0.8, 1), 0.33, "precipitation_snowgrains.png" },
-        { Ogre::ColourValue(0.8, 0.8, 0.8, 1), 0.70, "precipitation_icecrystals.png" },
-        { Ogre::ColourValue(0.8, 0.8, 0.8, 1), 0.78, "precipitation_icepellets.png" },
-        { Ogre::ColourValue(0.8, 0.8, 0.8, 1), 0.74, "precipitation_hail.png" },
-        { Ogre::ColourValue(0.8, 0.8, 0.8, 1), 0.70, "precipitation_smallhail.png" }
-	};
-
-	PrecipitationController::PrecipitationController(
-            Ogre::SceneManager *sceneMgr)
-    {
-		Ogre::String uniqueId = Ogre::StringConverter::toString((size_t)this);
-		mSceneMgr = sceneMgr;
-
-        setAutoDisableThreshold (0.001);
-        mCameraSpeedScale = Ogre::Vector3::UNIT_SCALE;
-
-        setIntensity (0);
-		setWindSpeed (Ogre::Vector3(0, 0, 0));
-		mInternalTime = 0;
-		mSecondsSinceLastFrame = 0;
-        mFallingDirection = Ogre::Vector3::NEGATIVE_UNIT_Y;
-
-		setPresetType (PRECTYPE_RAIN);
-		
-		update (0, Ogre::ColourValue(0, 0, 0, 0));
-        InternalUtilities::checkCompositorSupported(COMPOSITOR_NAME);
-	}
-
-	PrecipitationController::~PrecipitationController () {
-        destroyAllViewportInstances ();
-	}
-
-	void PrecipitationController::setTextureName (const Ogre::String& textureName) {
-        mPresetType = PRECTYPE_CUSTOM;
-		mTextureName = textureName;
-	}
-	
-	const Ogre::String PrecipitationController::getTextureName () const {
-		return mTextureName;
-	}
-
-	void PrecipitationController::setSpeed (Real speed) {
-        mPresetType = PRECTYPE_CUSTOM;
-		mSpeed = speed;
-	}
-
-	Real PrecipitationController::getSpeed () const {
-		return mSpeed;
-	}
-
-	void PrecipitationController::setColour (const Ogre::ColourValue& color) {
-        mPresetType = PRECTYPE_CUSTOM;
-		mColour = color;
-	}
-	
-	const Ogre::ColourValue PrecipitationController::getColour () const {
-		return mColour;
-	}
-
-	bool PrecipitationController::isPresetType (PrecipitationType type) {
-        return PRECTYPE_DRIZZLE <= type && type <= PRECTYPE_SMALLHAIL;
-    }
-
-	const PrecipitationPresetParams& PrecipitationController::getPresetParams (PrecipitationType type) {
-        assert(isPresetType(type));
-        return PrecipitationPresets[type];
-    }
-
-	void PrecipitationController::setParams (const PrecipitationPresetParams& params) {
-		setColour (params.Colour);
-		setSpeed (params.Speed);
-		setTextureName (params.Name);
-    }
-
-	void PrecipitationController::setPresetType (PrecipitationType type) {
-        setParams (getPresetParams (type));
-		mPresetType = type;
-	}
-
-	PrecipitationType PrecipitationController::getPresetType () const {
-        return mPresetType;
-	}
-
-	void PrecipitationController::setWindSpeed (const Ogre::Vector3& value) {
-		mWindSpeed = value;
-	}
-
-	const Ogre::Vector3 PrecipitationController::getWindSpeed () const {
-		return mWindSpeed;
-	}
-
-	void PrecipitationController::setIntensity (Real intensity) {
-		mIntensity = intensity;
-	}
-
-	Real PrecipitationController::getIntensity () const {
-		return mIntensity;
-	}
-
-	void PrecipitationController::update (Real secondsSinceLastFrame, Ogre::ColourValue colour) {
-        mSecondsSinceLastFrame = secondsSinceLastFrame;
-        mInternalTime += mSecondsSinceLastFrame;
-        mSceneColour = colour;
-
-        ViewportInstanceMap::const_iterator it;
-        ViewportInstanceMap::const_iterator begin = mViewportInstanceMap.begin ();
-        ViewportInstanceMap::const_iterator end = mViewportInstanceMap.end ();
-        for (it = begin; it != end; ++it) {
-            it->second->_update ();
-        }
-	}
-
-	void PrecipitationController::setManualCameraSpeed (const Ogre::Vector3& value) {
-        ViewportInstanceMap::const_iterator it;
-        ViewportInstanceMap::const_iterator begin = mViewportInstanceMap.begin();
-        ViewportInstanceMap::const_iterator end = mViewportInstanceMap.end();
-        for (it = begin; it != end; ++it) {
-            it->second->setManualCameraSpeed(value);
-        }
-	}
-
-	void PrecipitationController::setAutoCameraSpeed() {
-        ViewportInstanceMap::const_iterator it;
-        ViewportInstanceMap::const_iterator begin = mViewportInstanceMap.begin();
-        ViewportInstanceMap::const_iterator end = mViewportInstanceMap.end();
-        for (it = begin; it != end; ++it) {
-            it->second->setAutoCameraSpeed();
-        }
-	}
-
-    PrecipitationInstance::PrecipitationInstance
-    (
-        PrecipitationController* parent,
-        Ogre::Viewport* viewport
-    ):
-        mParent(parent),
-        mViewport(viewport),
-        mCompInst(0),
-        mLastCamera(0),
-        mLastCameraPosition(Vector3::ZERO),
-        mCameraSpeed(Vector3::ZERO),
-        mAutoCameraSpeed(true)
-    {
-        createCompositor ();
-    }
-
-    PrecipitationInstance::~PrecipitationInstance ()
-    {
-        destroyCompositor();
-    }
-
-    void PrecipitationInstance::createCompositor ()
-    {
-        // Check if nothing to do.
-        if (mCompInst) {
-            return;
-        }
-
-        Ogre::CompositorManager* compMgr = Ogre::CompositorManager::getSingletonPtr();
-		
-        // Create the precipitation compositor.
-        mCompInst = compMgr->addCompositor(mViewport, PrecipitationController::COMPOSITOR_NAME);
-        assert(mCompInst);
-		mCompInst->setEnabled (false);
-		mCompInst->addListener (this);
-    }
-
-    void PrecipitationInstance::destroyCompositor ()
-    {
-        // Check if nothing to do.
-        if (mCompInst == 0) {
-            return;
-        }
-
-        Ogre::CompositorManager* compMgr = Ogre::CompositorManager::getSingletonPtr();
-
-        // Remove the precipitation compositor.
-		mCompInst->removeListener (this);
-        compMgr->removeCompositor(mViewport, PrecipitationController::COMPOSITOR_NAME);
-        mCompInst = 0;
-    }
-
-	void PrecipitationInstance::notifyMaterialSetup(uint pass_id, Ogre::MaterialPtr &mat)
-	{
-        mParams.setup(mat->getTechnique (0)->getPass (0)->getFragmentProgramParameters ());
-	}
-
-    void PrecipitationInstance::Params::setup(Ogre::GpuProgramParametersSharedPtr fpParams)
-    {
-        this->fpParams = fpParams;
-        this->precColor.bind(fpParams, "precColor");
-        this->intensity.bind(fpParams, "intensity");
-        this->dropSpeed.bind(fpParams, "dropSpeed");
-        this->corner1.bind(fpParams, "corner1");
-        this->corner2.bind(fpParams, "corner2");
-        this->corner3.bind(fpParams, "corner3");
-        this->corner4.bind(fpParams, "corner4");
-        this->deltaX.bind(fpParams, "deltaX");
-        this->deltaY.bind(fpParams, "deltaY");
-    }
-
-	void PrecipitationInstance::notifyMaterialRender(uint pass_id, Ogre::MaterialPtr &mat)
-	{
-        if (mAutoCameraSpeed) {
-			Ogre::Camera* cam = mViewport->getCamera();
-			Ogre::Vector3 camPos = cam->getDerivedPosition();
-            if (cam != mLastCamera) {
-                mCameraSpeed = Ogre::Vector3::ZERO;
-            } else {
-                Real timeDiff = mParent->getSecondsSinceLastFrame ();
-                Ogre::Vector3 posDiff = camPos - mLastCameraPosition;
-
-                // Avoid division by 0 and keep old camera speed.
-                if (timeDiff > 1e-10) {
-                    mCameraSpeed = posDiff / timeDiff;
-                } else {
-                    // Keep old camera speed.
-                }
-
-                /*
-                LogManager::getSingletonPtr ()->logMessage (
-                        "Caelum::PrecipitationInstance:"
-                        " posDiff = " + StringConverter::toString(posDiff) +
-                        " timeDiff = " + StringConverter::toString(mParent->getSecondsSinceLastFrame (), 10) +
-                        " speed = " + StringConverter::toString(mCameraSpeed));
-                */
-            }
-            mLastCamera = cam;
-            mLastCameraPosition = camPos;
-        }
-
-        this->_updateMaterialParams(mat, mViewport->getCamera(), mCameraSpeed);
-    }
-
-	void PrecipitationInstance::_updateMaterialParams(
-            const Ogre::MaterialPtr& mat,
-            const Ogre::Camera* cam,
-            const Ogre::Vector3& camSpeed) 
-    {
-		// 4523.893416f is divisible with all the sine periods in the shader
-        Real appTime = static_cast<Real>(fmod(mParent->mInternalTime, static_cast<Real>(4523.893416f)));
-
-        ColourValue sceneColour = mParent->mSceneColour;
-		Real sceneLum = (sceneColour.r + sceneColour.g + sceneColour.b) / 3;
-        mParams.precColor.set(mParams.fpParams, ColourValue::White * sceneLum * mParent->mColour);
-		mParams.intensity.set(mParams.fpParams, mParent->mIntensity);
-		mParams.dropSpeed.set(mParams.fpParams, 0);		
-
-		Ogre::Vector3 corner1, corner2, corner3, corner4;
-
-		corner1 = cam->getCameraToViewportRay(0, 0).getDirection();
-		corner2 = cam->getCameraToViewportRay(1, 0).getDirection();
-		corner3 = cam->getCameraToViewportRay(0, 1).getDirection();
-		corner4 = cam->getCameraToViewportRay(1, 1).getDirection();
-
-		Ogre::Vector3 precDir =
-                mParent->mSpeed * mParent->mFallingDirection +
-                mParent->mWindSpeed -
-                camSpeed * mParent->mCameraSpeedScale;
-		Ogre::Quaternion quat = precDir.getRotationTo(Ogre::Vector3(0, -1, 0));
-
-		corner1 = quat * corner1;
-		corner2 = quat * corner2;
-		corner3 = quat * corner3;
-		corner4 = quat * corner4;
-
-		mParams.corner1.set(mParams.fpParams, corner1);
-		mParams.corner2.set(mParams.fpParams, corner2);
-		mParams.corner3.set(mParams.fpParams, corner3);
-		mParams.corner4.set(mParams.fpParams, corner4);		
-		
-		float fallSpeed = precDir.length();
-
-		mParams.deltaX.set(mParams.fpParams,
-                Ogre::Vector3(sin(appTime) + 4.33,
-                cos(appTime * 1.5) + 5.26,
-				cos(appTime * 2.5)) * fallSpeed / 10 + 88.001);
-		mParams.deltaY.set(mParams.fpParams,
-                Ogre::Vector3(0.6, 1.0, 1.4) * fallSpeed * appTime);
-
-        if (mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->getTextureName() != mParent->mTextureName) {
-			mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName(mParent->mTextureName);
-        }
-	}
-
-    bool PrecipitationInstance::getAutoCameraSpeed () {
-        return mAutoCameraSpeed;
-    }
-
-    void PrecipitationInstance::setAutoCameraSpeed () {
-        mAutoCameraSpeed = true;
-        mCameraSpeed = Ogre::Vector3::ZERO;
-        mLastCamera = 0;
-    }
-
-    void PrecipitationInstance::setManualCameraSpeed (const Ogre::Vector3& value) {
-        mAutoCameraSpeed = false;
-        mCameraSpeed = value;
-    }
-
-    const Ogre::Vector3 PrecipitationInstance::getCameraSpeed () {
-        return mCameraSpeed;
-    }
-
-    bool PrecipitationInstance::shouldBeEnabled () const {
-        return mParent->getAutoDisableThreshold () < 0 ||
-               mParent->getIntensity () > mParent->getAutoDisableThreshold ();
-    }
-
-    void PrecipitationInstance::_update ()
-    {
-        mCompInst->setEnabled (shouldBeEnabled ());
-    }
-
-    PrecipitationInstance* PrecipitationController::createViewportInstance (Ogre::Viewport* vp)
-    {
-        ViewportInstanceMap::const_iterator it = mViewportInstanceMap.find (vp);
-        if (it == mViewportInstanceMap.end()) {
-            std::auto_ptr<PrecipitationInstance> inst (new PrecipitationInstance(this, vp));
-            mViewportInstanceMap.insert (std::make_pair (vp, inst.get()));
-            // hold instance until successfully added to map.
-            return inst.release();
-        } else {
-            return it->second;
-        }
-    }
-    
-    PrecipitationInstance* PrecipitationController::getViewportInstance(Ogre::Viewport* vp) {
-        ViewportInstanceMap::iterator it = mViewportInstanceMap.find (vp);
-        if (it != mViewportInstanceMap.end ()) {
-            return it->second;
-        } else {
-            return 0;
-        }
-    }
-
-    void PrecipitationController::destroyViewportInstance (Viewport* vp)
-    {
-        ViewportInstanceMap::iterator it = mViewportInstanceMap.find (vp);
-        if (it != mViewportInstanceMap.end ()) {
-            PrecipitationInstance* inst = it->second;
-            delete inst;
-            mViewportInstanceMap.erase (it);
-        }
-    }
-
-    void PrecipitationController::destroyAllViewportInstances () {
-        ViewportInstanceMap::const_iterator it;
-        ViewportInstanceMap::const_iterator begin = mViewportInstanceMap.begin();
-        ViewportInstanceMap::const_iterator end = mViewportInstanceMap.end();
-        for (it = begin; it != end; ++it) {
-            assert(it->first == it->second->getViewport ());
-            delete it->second;
-        }
-        mViewportInstanceMap.clear ();
-    }
-}
diff --git a/extern/caelum/src/SkyDome.cpp b/extern/caelum/src/SkyDome.cpp
deleted file mode 100644
index 864f8cce07..0000000000
--- a/extern/caelum/src/SkyDome.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "SkyDome.h"
-#include "CaelumExceptions.h"
-#include "InternalUtilities.h"
-
-namespace Caelum
-{
-    const Ogre::String SkyDome::SPHERIC_DOME_NAME = "CaelumSphericDome";
-    const Ogre::String SkyDome::SKY_DOME_MATERIAL_NAME = "CaelumSkyDomeMaterial";
-
-    SkyDome::SkyDome (Ogre::SceneManager *sceneMgr, Ogre::SceneNode *caelumRootNode)
-    {
-        String uniqueSuffix = "/" + InternalUtilities::pointerToString(this);
-
-        // First clone material
-        mMaterial.reset(InternalUtilities::checkLoadMaterialClone(SKY_DOME_MATERIAL_NAME, SKY_DOME_MATERIAL_NAME + uniqueSuffix));
-
-        // Determine if the shader technique works.
-        mShadersEnabled = mMaterial->getBestTechnique()->getPass(0)->isProgrammable();
-
-        // Force setting haze, ensure mHazeEnabled != value.
-        mHazeEnabled = true;
-        setHazeEnabled(false);
-
-        sceneMgr->getRenderQueue()->getQueueGroup(CAELUM_RENDER_QUEUE_SKYDOME)->setShadowsEnabled(false);
-
-        // Generate dome entity.
-        InternalUtilities::generateSphericDome (SPHERIC_DOME_NAME, 32, InternalUtilities::DT_SKY_DOME);
-        mEntity.reset(sceneMgr->createEntity ("Caelum/SkyDome/Entity" + uniqueSuffix, SPHERIC_DOME_NAME));
-        mEntity->setMaterialName (mMaterial->getName());
-        mEntity->setRenderQueueGroup (CAELUM_RENDER_QUEUE_SKYDOME);
-        mEntity->setCastShadows (false);
-
-        mNode.reset(caelumRootNode->createChildSceneNode ("Caelum/SkyDome/Node" + uniqueSuffix));
-        mNode->attachObject (mEntity.get());
-    }
-
-    SkyDome::~SkyDome () {
-    }
-
-    void SkyDome::notifyCameraChanged (Ogre::Camera *cam) {
-        CameraBoundElement::notifyCameraChanged (cam);
-    }
-
-    void SkyDome::setFarRadius (Ogre::Real radius) {
-        CameraBoundElement::setFarRadius(radius);
-        mNode->setScale (Ogre::Vector3::UNIT_SCALE * radius);
-    }
-
-    void SkyDome::setSunDirection (const Ogre::Vector3& sunDir) {
-        float elevation = sunDir.dotProduct (Ogre::Vector3::UNIT_Y);
-        elevation = elevation * 0.5 + 0.5;
-        Ogre::Pass* pass = mMaterial->getBestTechnique()->getPass(0);
-        if (mShadersEnabled) {
-            mParams.sunDirection.set(mParams.vpParams, sunDir);
-            mParams.offset.set(mParams.fpParams, elevation);
-        } else {
-            Ogre::TextureUnitState* gradientsTus = pass->getTextureUnitState(0);
-            gradientsTus->setTextureUScroll (elevation);
-        }
-    }
-
-    void SkyDome::setHazeColour (const Ogre::ColourValue& hazeColour) {
-        if (mShadersEnabled && mHazeEnabled) {
-            mParams.hazeColour.set(mParams.fpParams, hazeColour);
-        }    
-    }
-
-    void SkyDome::setSkyGradientsImage (const Ogre::String& gradients)
-    {
-        Ogre::TextureUnitState* gradientsTus =
-                mMaterial->getTechnique (0)->getPass (0)->getTextureUnitState(0);
-
-        gradientsTus->setTextureAddressingMode (Ogre::TextureUnitState::TAM_CLAMP);
-
-        // Per 1.4 compatibility. Not tested with recent svn.
-        #if OGRE_VERSION < ((1 << 16) | (3 << 8))
-            gradientsTus->setTextureName (gradients, Ogre::TEX_TYPE_2D, -1, true);
-        #else
-            gradientsTus->setTextureName (gradients, Ogre::TEX_TYPE_2D);
-            gradientsTus->setIsAlpha (true);
-        #endif
-    }
-
-    void SkyDome::setAtmosphereDepthImage (const Ogre::String& atmosphereDepth)
-    {
-        if (!mShadersEnabled) {
-            return;
-        }
-
-        Ogre::TextureUnitState* atmosphereTus =
-                mMaterial->getTechnique (0)->getPass (0)->getTextureUnitState(1);
-
-        atmosphereTus->setTextureName (atmosphereDepth, Ogre::TEX_TYPE_1D);
-        atmosphereTus->setTextureAddressingMode (Ogre::TextureUnitState::TAM_CLAMP, Ogre::TextureUnitState::TAM_WRAP, Ogre::TextureUnitState::TAM_WRAP);
-    }
-
-    bool SkyDome::getHazeEnabled () const {
-        return mHazeEnabled;
-    }
-
-    void SkyDome::setHazeEnabled (bool value)
-    {
-        if (mHazeEnabled == value) {
-            return;
-        }
-        mHazeEnabled = value;
-
-        if (!mShadersEnabled) {
-            return;
-        }
-
-        Ogre::Pass *pass = mMaterial->getTechnique (0)->getPass (0);
-        if (value) {
-            pass->setFragmentProgram("CaelumSkyDomeFP");
-        } else {
-            pass->setFragmentProgram("CaelumSkyDomeFP_NoHaze");
-        }
-        mParams.setup(
-                pass->getVertexProgramParameters(),
-                pass->getFragmentProgramParameters());
-    }
-
-    void SkyDome::Params::setup(Ogre::GpuProgramParametersSharedPtr vpParams, Ogre::GpuProgramParametersSharedPtr fpParams)
-    {
-        this->fpParams = fpParams;
-        this->vpParams = vpParams;
-        sunDirection.bind(vpParams, "sunDirection");
-        offset.bind(fpParams, "offset");
-        hazeColour.bind(fpParams, "hazeColour");
-    }
-}
diff --git a/extern/caelum/src/SkyLight.cpp b/extern/caelum/src/SkyLight.cpp
deleted file mode 100644
index 68ace1070e..0000000000
--- a/extern/caelum/src/SkyLight.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "SkyLight.h"
-
-namespace Caelum
-{
-    const Ogre::Real BaseSkyLight::DEFAULT_AUTO_DISABLE_THRESHOLD = 0.1;
-
-    BaseSkyLight::BaseSkyLight (Ogre::SceneManager *sceneMgr, Ogre::SceneNode *caelumRootNode):
-            mDirection(Ogre::Vector3::ZERO),
-            mBodyColour(Ogre::ColourValue::White),
-            mLightColour(Ogre::ColourValue::White),
-
-            mDiffuseMultiplier(Ogre::ColourValue(1, 1, 0.9)),
-            mSpecularMultiplier(Ogre::ColourValue(1, 1, 1)),
-            mAmbientMultiplier(Ogre::ColourValue(0.2, 0.2, 0.2)),
-
-            mAutoDisableLight(false),
-            mAutoDisableThreshold(DEFAULT_AUTO_DISABLE_THRESHOLD),
-            mForceDisableLight(false)
-    {
-        Ogre::String lightName = "CaelumSkyLight" + Ogre::StringConverter::toString((size_t)this);
-
-        mMainLight = sceneMgr->createLight (lightName);
-        mMainLight->setType (Ogre::Light::LT_DIRECTIONAL);
-
-        sceneMgr->getRenderQueue()->getQueueGroup(CAELUM_RENDER_QUEUE_SUN)->setShadowsEnabled(false);
-
-        mNode = caelumRootNode->createChildSceneNode ();
-    }
-
-    BaseSkyLight::~BaseSkyLight () {
-        if (mNode) {
-            static_cast<Ogre::SceneNode *>(mNode->getParent ())->removeAndDestroyChild (mNode->getName ());
-            mNode = 0;
-        }
-
-        if (mMainLight) {
-            mMainLight->_getManager ()->destroyLight (mMainLight);
-            mMainLight = 0;
-        }
-    }
-
-    void BaseSkyLight::setFarRadius (Ogre::Real radius) {
-        CameraBoundElement::setFarRadius(radius);
-        mRadius = radius;
-    }
-
-    void BaseSkyLight::update (
-            const Ogre::Vector3& direction,
-            const Ogre::ColourValue &lightColour,
-            const Ogre::ColourValue &bodyColour)
-    {
-        setLightDirection(direction);
-        setLightColour(lightColour);
-        setBodyColour(bodyColour);
-    }
-
-    const Ogre::Vector3 BaseSkyLight::getLightDirection () const {
-        return mDirection;
-    }
-
-    void BaseSkyLight::setLightDirection (const Ogre::Vector3 &dir) {
-        mDirection = dir;
-        if (mMainLight != 0) {
-            mMainLight->setDirection (mNode->_getDerivedOrientation() * dir);
-        }
-    }
-
-    void BaseSkyLight::setBodyColour (const Ogre::ColourValue &colour) {
-        // Store this last colour
-        mBodyColour = colour;
-    }
-
-    const Ogre::ColourValue BaseSkyLight::getBodyColour () const {
-        return mBodyColour;
-    }
-
-    void BaseSkyLight::setLightColour (const Ogre::ColourValue &colour) {
-        // Store this last colour
-        mLightColour = colour;
-        // Apply change
-        setMainLightColour(colour);
-    }
-
-    void BaseSkyLight::setMainLightColour (const Ogre::ColourValue &colour) {
-        // Set light colours.
-        bool enable = shouldEnableLight (colour);
-        if (enable) {
-            mMainLight->setVisible(true);
-            mMainLight->setDiffuseColour (colour * mDiffuseMultiplier);
-            mMainLight->setSpecularColour (colour * mSpecularMultiplier);
-        } else {
-            mMainLight->setVisible(false);
-        }
-    }
-
-    const Ogre::ColourValue BaseSkyLight::getLightColour () const {
-        return mLightColour;
-    }
-
-    void BaseSkyLight::setDiffuseMultiplier (const Ogre::ColourValue &diffuse) {
-        mDiffuseMultiplier = diffuse;
-    }
-
-    const Ogre::ColourValue BaseSkyLight::getDiffuseMultiplier () const {
-        return mDiffuseMultiplier;
-    }
-
-    void BaseSkyLight::setSpecularMultiplier (const Ogre::ColourValue &specular) {
-        mSpecularMultiplier = specular;
-    }
-
-    const Ogre::ColourValue BaseSkyLight::getSpecularMultiplier () const {
-        return mSpecularMultiplier;
-    }
-
-    void BaseSkyLight::setAmbientMultiplier (const Ogre::ColourValue &ambient) {
-        mAmbientMultiplier = ambient;
-    }
-
-    const Ogre::ColourValue BaseSkyLight::getAmbientMultiplier () const {
-        return mAmbientMultiplier;
-    }
-
-    Ogre::Light* BaseSkyLight::getMainLight() const {
-        return mMainLight;
-    }
-
-    bool BaseSkyLight::shouldEnableLight(const Ogre::ColourValue &colour) {
-        if (mForceDisableLight) {
-            return false;
-        }
-        if (mAutoDisableLight) {
-            Ogre::Real sum = colour.r + colour.g + colour.b;
-            return sum >= mAutoDisableThreshold;
-        } else {
-            return true;
-        }
-    }
-}
diff --git a/extern/caelum/src/Sun.cpp b/extern/caelum/src/Sun.cpp
deleted file mode 100644
index 36c887c352..0000000000
--- a/extern/caelum/src/Sun.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "Sun.h"
-#include "InternalUtilities.h"
-
-namespace Caelum
-{
-    const Ogre::String SphereSun::SUN_MATERIAL_NAME = "CaelumSphereSun";
-
-    SphereSun::SphereSun
-    (
-        Ogre::SceneManager *sceneMgr,
-        Ogre::SceneNode *caelumRootNode,
-        const Ogre::String &meshName
-    ):
-        BaseSkyLight(sceneMgr, caelumRootNode)
-    {
-        Ogre::String uniqueSuffix = "/" + InternalUtilities::pointerToString (this);
-        mSunMaterial.reset (InternalUtilities::checkLoadMaterialClone (SUN_MATERIAL_NAME, SUN_MATERIAL_NAME + uniqueSuffix));
-
-        mSunEntity.reset (sceneMgr->createEntity ("Caelum/SphereSun" + uniqueSuffix, meshName));
-        mSunEntity->setMaterialName (mSunMaterial->getName ());
-        mSunEntity->setCastShadows (false);
-        mSunEntity->setRenderQueueGroup (CAELUM_RENDER_QUEUE_SUN);
-
-        mNode->attachObject (mSunEntity.get ());
-    }
-
-    SphereSun::~SphereSun () { }
-
-    void SphereSun::setBodyColour (const Ogre::ColourValue &colour) {
-        BaseSkyLight::setBodyColour(colour);
-
-        // Set sun material colour.
-        mSunMaterial->setSelfIllumination (colour);
-    }
-
-    void SphereSun::notifyCameraChanged (Ogre::Camera *cam) {
-        // This calls setFarRadius
-        CameraBoundElement::notifyCameraChanged(cam);
-
-        // Set sun position.
-        Ogre::Real sunDistance = mRadius - mRadius * Ogre::Math::Tan (Ogre::Degree (0.01));
-        mNode->setPosition(-mDirection * sunDistance);
-
-        // Set sun scaling  in [1.6(6) ~ 2.0] range.
-        float factor = 2 - mBodyColour.b / 3;
-        float scale = factor * sunDistance * Ogre::Math::Tan (Ogre::Degree (0.01));
-        mNode->setScale (Ogre::Vector3::UNIT_SCALE * scale);
-    }
-
-    const Ogre::String SpriteSun::SUN_MATERIAL_NAME = "CaelumSpriteSun";
-
-    SpriteSun::SpriteSun (
-            Ogre::SceneManager *sceneMgr,
-            Ogre::SceneNode *caelumRootNode, 
-            const Ogre::String &sunTextureName,
-            const Ogre::Degree& sunTextureAngularSize
-    ):
-        BaseSkyLight(sceneMgr, caelumRootNode),
-        mSunTextureAngularSize(sunTextureAngularSize)
-    {
-        Ogre::String uniqueSuffix = "/" + InternalUtilities::pointerToString (this);
-
-        mSunMaterial.reset (InternalUtilities::checkLoadMaterialClone (SUN_MATERIAL_NAME, SUN_MATERIAL_NAME + uniqueSuffix));
-        setSunTexture (sunTextureName);
-
-        mSunBillboardSet.reset (sceneMgr->createBillboardSet ("Caelum/SpriteSun" + uniqueSuffix, 2));
-        mSunBillboardSet->setMaterialName (mSunMaterial->getName());
-        mSunBillboardSet->setCastShadows (false);
-        mSunBillboardSet->setRenderQueueGroup (CAELUM_RENDER_QUEUE_SUN);
-        mSunBillboardSet->setDefaultDimensions (1.0f, 1.0f);
-        mSunBillboardSet->createBillboard (Ogre::Vector3::ZERO);
-
-        mNode->attachObject (mSunBillboardSet.get ());
-    }
-
-    SpriteSun::~SpriteSun () { }
-
-    void SpriteSun::setBodyColour (const Ogre::ColourValue &colour) {
-        BaseSkyLight::setBodyColour (colour);
-
-        // Set sun material colour.
-        mSunBillboardSet->getBillboard (0)->setColour (colour);
-    }
-
-    void SpriteSun::setSunTexture (const Ogre::String &textureName) {
-        // Update the sun material
-        assert(mSunMaterial->getBestTechnique ());
-        assert(mSunMaterial->getBestTechnique ()->getPass (0));
-        assert(mSunMaterial->getBestTechnique ()->getPass (0)->getTextureUnitState (0));
-        mSunMaterial->getBestTechnique ()->getPass (0)->getTextureUnitState (0)->setTextureName (textureName);
-    }
-
-    void SpriteSun::setSunTextureAngularSize(const Ogre::Degree& sunTextureAngularSize){
-        mSunTextureAngularSize = sunTextureAngularSize;
-    }
-
-    void SpriteSun::notifyCameraChanged (Ogre::Camera *cam) {
-        // This calls setFarRadius
-        BaseSkyLight::notifyCameraChanged(cam);
-
-        // Set sun position.
-        Ogre::Real sunDistance = mRadius - mRadius * Ogre::Math::Tan(mSunTextureAngularSize);
-        mNode->setPosition (-mDirection * sunDistance);
-
-        // Set sun scaling in [1.0 ~ 1.2] range
-        float factor = 1.2f - mBodyColour.b * 0.2f;
-        float scale = factor * sunDistance * Ogre::Math::Tan(mSunTextureAngularSize);
-        mNode->setScale (Ogre::Vector3::UNIT_SCALE * scale);
-    }
-}
diff --git a/extern/caelum/src/TypeDescriptor.cpp b/extern/caelum/src/TypeDescriptor.cpp
deleted file mode 100644
index 5ca889c6d7..0000000000
--- a/extern/caelum/src/TypeDescriptor.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "TypeDescriptor.h"
-
-#if CAELUM_TYPE_DESCRIPTORS
-
-using namespace Ogre;
-
-namespace Caelum
-{
-    DefaultTypeDescriptor::DefaultTypeDescriptor ()
-    {
-    }
-    
-    DefaultTypeDescriptor::~DefaultTypeDescriptor () {
-        for (TypeDescriptor::PropertyMap::const_iterator it = mPropertyMap.begin(), end = mPropertyMap.end(); it != end; ++it) {
-            delete it->second;
-        }
-    }
-
-    const ValuePropertyDescriptor* DefaultTypeDescriptor::getPropertyDescriptor (const Ogre::String& name) const
-    {
-        PropertyMap::const_iterator it = mPropertyMap.find(name);
-        if (it != mPropertyMap.end()) {
-            return it->second;
-        } else {
-            return 0;
-        }
-    }
-
-    const std::vector<String> DefaultTypeDescriptor::getPropertyNames () const
-    {
-        std::vector<String> result;
-        for (TypeDescriptor::PropertyMap::const_iterator it = mPropertyMap.begin(), end = mPropertyMap.end(); it != end; ++it) {
-            result.push_back(it->first);
-        }
-        return result;
-    }
-
-    const TypeDescriptor::PropertyMap DefaultTypeDescriptor::getFullPropertyMap () const {
-        return mPropertyMap;
-    }
-
-    void DefaultTypeDescriptor::add (const Ogre::String& name, const ValuePropertyDescriptor* descriptor)
-    {
-        mPropertyMap.insert(make_pair(name, descriptor));
-    }
-}
-
-#endif
diff --git a/extern/caelum/src/UniversalClock.cpp b/extern/caelum/src/UniversalClock.cpp
deleted file mode 100644
index 5f00f4dd6a..0000000000
--- a/extern/caelum/src/UniversalClock.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-This file is part of Caelum.
-See http://www.ogre3d.org/wiki/index.php/Caelum 
-
-Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
-
-Caelum is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published
-by the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Caelum is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with Caelum. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "CaelumPrecompiled.h"
-#include "UniversalClock.h"
-#include "Astronomy.h"
-
-namespace Caelum
-{
-    const Caelum::LongReal UniversalClock::SECONDS_PER_DAY = 86400.0;
-
-    UniversalClock::UniversalClock () {
-        setJulianDay (Astronomy::J2000);        
-	    setTimeScale (1.0);
-    }
-
-    void UniversalClock::setJulianDay (Caelum::LongReal value) {
-        mJulianDayBase = value;
-        mCurrentTime = 0;
-        mLastUpdateTime = 0;
-    }
-
-    void UniversalClock::setGregorianDateTime(
-            int year, int month, int day,
-            int hour, int minute, double second)
-    {
-        ScopedHighPrecissionFloatSwitch precissionSwitch;
-        setJulianDay(Astronomy::getJulianDayFromGregorianDateTime(year, month, day, hour, minute, second));
-    }
-
-    LongReal UniversalClock::getJulianDay () const
-    {
-        ScopedHighPrecissionFloatSwitch precissionSwitch;
-        Caelum::LongReal res = mJulianDayBase + mCurrentTime / SECONDS_PER_DAY;
-        return res;
-    }
-
-    LongReal UniversalClock::getJulianDayDifference () const {
-        ScopedHighPrecissionFloatSwitch precissionSwitch;
-        return (mCurrentTime - mLastUpdateTime) / SECONDS_PER_DAY;
-    }
-
-    LongReal UniversalClock::getJulianSecond () const {
-        ScopedHighPrecissionFloatSwitch precissionSwitch;
-        LongReal res = mJulianDayBase * SECONDS_PER_DAY + mCurrentTime;
-        return res;
-    }
-
-    LongReal UniversalClock::getJulianSecondDifference () const {
-        ScopedHighPrecissionFloatSwitch precissionSwitch;
-        return mCurrentTime - mLastUpdateTime;
-    }
-
-    void UniversalClock::setTimeScale (const Ogre::Real scale) {
-	    mTimeScale = scale;
-    }
-
-    Ogre::Real UniversalClock::getTimeScale () const {
-	    return mTimeScale;
-    }
-
-    void UniversalClock::update (const Ogre::Real time) {
-        mLastUpdateTime = mCurrentTime;
-        mCurrentTime += time * mTimeScale;
-    }
-}
-
diff --git a/extern/mygui_3.0.1/CMakeLists.txt b/extern/mygui_3.0.1/CMakeLists.txt
index 6e54d1adc6..2cbe8aabe6 100644
--- a/extern/mygui_3.0.1/CMakeLists.txt
+++ b/extern/mygui_3.0.1/CMakeLists.txt
@@ -66,6 +66,8 @@ configure_file("${SDIR}/openmw_text.skin.xml" "${DDIR}/openmw_text.skin.xml" COP
 configure_file("${SDIR}/openmw_windows.skin.xml" "${DDIR}/openmw_windows.skin.xml" COPYONLY)
 configure_file("${SDIR}/openmw_messagebox_layout.xml" "${DDIR}/openmw_messagebox_layout.xml" COPYONLY)
 configure_file("${SDIR}/openmw_interactive_messagebox_layout.xml" "${DDIR}/openmw_interactive_messagebox_layout.xml" COPYONLY)
+configure_file("${SDIR}/openmw_journal_layout.xml" "${DDIR}/openmw_journal_layout.xml" COPYONLY)
+configure_file("${SDIR}/openmw_journal_skin.xml" "${DDIR}/openmw_journal_skin.xml" COPYONLY)
 configure_file("${SDIR}/smallbars.png" "${DDIR}/smallbars.png" COPYONLY)
 configure_file("${SDIR}/transparent.png" "${DDIR}/transparent.png" COPYONLY)
 configure_file("${SDIR}/VeraMono.ttf" "${DDIR}/VeraMono.ttf" COPYONLY)
diff --git a/extern/mygui_3.0.1/openmw_resources/core.xml b/extern/mygui_3.0.1/openmw_resources/core.xml
index 3d4d5ba3b9..31d409a35a 100644
--- a/extern/mygui_3.0.1/openmw_resources/core.xml
+++ b/extern/mygui_3.0.1/openmw_resources/core.xml
@@ -19,6 +19,7 @@
             <List file="openmw_hud_box.skin.xml" group="General"/>
             <List file="openmw_mainmenu_skin.xml" group="General"/>
             <List file="openmw_console.skin.xml" group="General"/>
+            <List file="openmw_journal_skin.xml" group="General"/>
     </MyGUI>
 
 </MyGUI>
diff --git a/extern/mygui_3.0.1/openmw_resources/openmw_hud_layout.xml b/extern/mygui_3.0.1/openmw_resources/openmw_hud_layout.xml
index 8dc3cebab4..9e5f26c5ba 100644
--- a/extern/mygui_3.0.1/openmw_resources/openmw_hud_layout.xml
+++ b/extern/mygui_3.0.1/openmw_resources/openmw_hud_layout.xml
@@ -49,12 +49,33 @@
         <Widget type="StaticImage" skin="StaticImage" position="0 0 32
             32" align="Center Center" name="Crosshair"/>
 
-        <!-- FPSCounter box -->
-
+        <!-- Basic FPSCounter box -->
         <Widget type="Widget" skin="HUD_Box" position="12 12 28 21" align="Left Top"
             name="FPSBox">
+            <Property key="Widget_Visible" value="false"/>
             <Widget type="StaticText" skin="NumFPS" position="3 3 21 17" name="FPSCounter"/>
         </Widget>
 
+        <!-- Advanced FPSCounter box -->
+        <Widget type="Widget" skin="HUD_Box" position="12 12 118 51" align="Left Top"
+            name="FPSBoxAdv">
+            <Property key="Widget_Visible" value="false"/>
+
+            <Widget type="StaticText" skin="NumFPS" position="3 3 71 17">
+                    <Property key="Widget_Caption" value="FPS: "/>
+            </Widget>
+            <Widget type="StaticText" skin="NumFPS" position="53 3 71 17" name="FPSCounterAdv"/>
+
+            <Widget type="StaticText" skin="NumFPS" position="3 3 71 32">
+                    <Property key="Widget_Caption" value="Tri Count: "/>
+            </Widget>
+            <Widget type="StaticText" skin="NumFPS" position="53 3 71 32" name="TriangleCounter"/>
+
+            <Widget type="StaticText" skin="NumFPS" position="3 3 71 47">
+                    <Property key="Widget_Caption" value="Batch Count: "/>
+            </Widget>
+            <Widget type="StaticText" skin="NumFPS" position="53 3 71 47" name="BatchCounter"/>
+        </Widget>
+
     </Widget>
 </MyGUI>
diff --git a/extern/mygui_3.0.1/openmw_resources/openmw_journal_layout.xml b/extern/mygui_3.0.1/openmw_resources/openmw_journal_layout.xml
new file mode 100644
index 0000000000..dc2116ee0a
--- /dev/null
+++ b/extern/mygui_3.0.1/openmw_resources/openmw_journal_layout.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<MyGUI type="Layout">
+
+<Widget type="Window" skin="" layer="Windows" align="Left|Top" position="00 200 512 256" name="_Main">
+
+<Widget type="StaticImage" skin="StaticImage" position_real="0 0 1 1" align="Top|Right" name="JImage">     
+<Property key="Image_Texture" value="textures\tx_menubook.dds"/>
+<!--Property key="Image_Texture" value="mwgui.png"/-->
+
+<Widget type="Button" skin="Next_btn" position="370 220 64 32" name="NextPageBTN">
+</Widget>
+
+<Widget type="Button" skin="Prev_btn" position="80 220 128 32" name="PrevPageBTN">
+</Widget>
+
+    <Widget type="Edit" skin="MW_BookPage" position_real="0.15 0.1 0.3 0.8" name = "LeftText"/>
+    <Widget type="Edit" skin="MW_BookPage" position_real="0.55 0.1 0.3 0.8" name = "RightText"/>
+</Widget>
+</Widget>
+
+
+</MyGUI>
diff --git a/extern/mygui_3.0.1/openmw_resources/openmw_journal_skin.xml b/extern/mygui_3.0.1/openmw_resources/openmw_journal_skin.xml
new file mode 100644
index 0000000000..b6cb1bca73
--- /dev/null
+++ b/extern/mygui_3.0.1/openmw_resources/openmw_journal_skin.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<MyGUI type="Skin">
+<Skin name="Next_btn" size="64 32" texture="textures\tx_menubook_next_idle.dds">
+<BasisSkin type="MainSkin" offset="0 0 64 32" align="ALIGN_VSTRETCH">
+<State name="normal" offset="0 0 64 32"/>
+</BasisSkin>
+</Skin>
+
+<Skin name="Prev_btn" size="128 32" texture="textures\tx_menubook_prev_idle.dds">
+<BasisSkin type="MainSkin" offset="0 0 128 32" align="ALIGN_VSTRETCH">
+<State name="normal" offset="0 0 128 32"/>
+</BasisSkin>
+</Skin>
+
+    <Skin name = "MW_BookClient" size = "10 10">
+        <Property key="FontName" value = "MonoFont" />
+        <Property key="AlignText" value = "Left Top" />
+        <Property key="Colour" value = "0000FF" />
+        <!--Property key="Pointer" value = "beam" /-->
+        <BasisSkin type="EditText" offset = "0 0 10 10" align = "Stretch"/>
+    </Skin>
+	
+    <Skin name="MW_BookPage" size="0 0 50 50">
+        <Property key="WordWrap" value = "true" />
+        <Child type="Widget" skin="MW_BookClient" offset="0 0 35 10" align = "ALIGN_STRETCH" name = "Client"/>
+        <!--Child type="VScroll" skin="VScroll" offset = "35 0 15 50" align = "Right VStretch" name = "VScroll"/-->
+    </Skin>
+</MyGUI>
diff --git a/files/mac/Info.plist b/files/mac/Info.plist
index 1872425e7c..bc7efd0754 100644
--- a/files/mac/Info.plist
+++ b/files/mac/Info.plist
@@ -19,7 +19,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>0.10</string>
+	<string>${OPENMW_VERSION}</string>
 	<key>CSResourcesFileMapped</key>
 	<true/>
 	<key>LSRequiresCarbon</key>
diff --git a/files/plugins.cfg.linux b/files/plugins.cfg.linux
index 2921153b4f..f34621a0f2 100644
--- a/files/plugins.cfg.linux
+++ b/files/plugins.cfg.linux
@@ -1,7 +1,7 @@
 # Defines plugins to load
 
 # Define plugin folder
-PluginFolder=${OGRE_PLUGIN_DIR}
+PluginFolder=${OGRE_PLUGIN_DIR_REL}
 
 # Define plugins
 Plugin=RenderSystem_GL
diff --git a/libs/openengine b/libs/openengine
index 2f5eca9d87..21b8456453 160000
--- a/libs/openengine
+++ b/libs/openengine
@@ -1 +1 @@
-Subproject commit 2f5eca9d878526bdd9dce93ece7f42093b481545
+Subproject commit 21b8456453242e132c85f92047cf9bce535c1b22
diff --git a/old_d_version/.gitignore b/old_d_version/.gitignore
deleted file mode 100644
index 23e6b6fd24..0000000000
--- a/old_d_version/.gitignore
+++ /dev/null
@@ -1,66 +0,0 @@
-
-# /
-/cache
-/later
-/openmw.ini.*
-/rr.sh
-/fontdump
-/MyGUI.log
-/upm.sh
-/raw.txt
-/vids
-/include
-/includes
-/.thumbnails
-/*.jpg
-/*.dll
-/*.exe
-/*.def
-/*.a
-/*.map
-/*.rsp
-/ogre.cfg
-/openmw
-/bored
-/bsatool
-/niftool
-/esmtool
-/bored.highscores
-/Ogre.log
-/openmw.ini
-/openmw.ini.old
-/dsss_*
-/dsss.last
-/objs
-/nifobjs
-
-# /bullet/
-/bullet/OgreOpcode*
-/bullet/demo
-/bullet/*.a
-
-# /media_mygui/
-/media_mygui/core.skin.orig
-/media_mygui/.thumbnails
-
-# /monster/
-/monster/*openmw_last
-
-# /mscripts/
-/mscripts/draft
-
-# /nif/
-/nif/bumpmap
-/nif/*.nif
-
-# /ogre/
-/ogre/*.nif
-/ogre/cs
-
-# /util/
-/util/iconv
-
-*.o
-*.patch
-*.diff
-.directory
diff --git a/old_d_version/bullet/bindings.d b/old_d_version/bullet/bindings.d
deleted file mode 100644
index 9dbd76197b..0000000000
--- a/old_d_version/bullet/bindings.d
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (bindings.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module bullet.bindings;
-
-/*
- * This module is the interface between D and the C++ code that
- * handles Bullet.
- */
-
-typedef void* BulletShape;
-
-extern(C):
-
-// Initialize the dynamic world. Returns non-zero if an error occurs.
-int bullet_init();
-
-// Set physics modes
-void bullet_nextMode();
-void bullet_walk();
-void bullet_fly();
-void bullet_ghost();
-
-// Warp the player to a specific location.
-void bullet_movePlayer(float x, float y, float z);
-
-// Request that the player moves in this direction
-void bullet_setPlayerDir(float x, float y, float z);
-
-// Get the current player position, after physics and collision have
-// been applied.
-void bullet_getPlayerPos(float *x, float *y, float *z);
-
-// Create a box shape. Used for bounding boxes. The box is a trimesh
-// and is hollow (you can walk inside it.)
-void bullet_createBoxShape(float minX, float minY, float minZ,
-                           float maxX, float maxY, float maxZ,
-                           float *trans,float *matrix);
-
-// Create a triangle shape. This is cumulative, all meshes created
-// with this function are added to the same shape. Since the various
-// parts of a mesh can be differently transformed and we are putting
-// them all in one shape, we must transform the vertices manually.
-void bullet_createTriShape(int numFaces,
-                           void *triArray,
-                           int numVerts,
-                           void *vertArray,
-                           float *trans,float *matrix);
-
-// "Flushes" the meshes created with createTriShape, returning the
-// pointer to the final shape object.
-BulletShape bullet_getFinalShape();
-
-// Insert a static mesh with the given translation, quaternion
-// rotation and scale. The quaternion is assumed to be in Ogre format,
-// ie. with the W first.
-void bullet_insertStatic(BulletShape shp, float *pos,
-                         float *quat, float scale);
-
-// Move the physics simulation 'delta' seconds forward in time
-void bullet_timeStep(float delta);
-
-// Deallocate objects
-void bullet_cleanup();
-
diff --git a/old_d_version/bullet/bullet.d b/old_d_version/bullet/bullet.d
deleted file mode 100644
index d33a22b7cc..0000000000
--- a/old_d_version/bullet/bullet.d
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (bullet.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module bullet.bullet;
-
-import bullet.bindings;
-
-void initBullet()
-{
-  if(bullet_init())
-    throw new Exception("Bullet setup failed");
-}
-
-void cleanupBullet() { bullet_cleanup(); }
diff --git a/old_d_version/bullet/cpp_bullet.cpp b/old_d_version/bullet/cpp_bullet.cpp
deleted file mode 100644
index 50af01b57e..0000000000
--- a/old_d_version/bullet/cpp_bullet.cpp
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (cpp_bullet.cpp) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-#include "btBulletDynamicsCommon.h"
-
-#include <iostream>
-
-#include "../util/dbg.h"
-
-using namespace std;
-
-class CustomOverlappingPairCallback;
-
-enum
-  {
-    MASK_PLAYER = 1,
-    MASK_STATIC = 2
-  };
-
-// System variables
-btDefaultCollisionConfiguration* g_collisionConfiguration;
-btCollisionDispatcher *g_dispatcher;
-//btBroadphaseInterface *g_broadphase;
-btAxisSweep3 *g_broadphase;
-btSequentialImpulseConstraintSolver* g_solver;
-btDynamicsWorld *g_dynamicsWorld;
-
-// Player variables
-btCollisionObject* g_playerObject;
-btConvexShape *g_playerShape;
-
-// Player position. This is updated automatically by the physics
-// system based on g_walkDirection and collisions. It is read by D
-// code through bullet_getPlayerPos().
-btVector3 g_playerPosition;
-
-// Walking vector - defines direction and speed that the player
-// intends to move right now. This is updated from D code each frame
-// through bullet_setPlayerDir(), based on player input (and later, AI
-// decisions.) The units of the vector are points per second.
-btVector3 g_walkDirection;
-
-// The current trimesh shape being built. All new inserted meshes are
-// added into this, until bullet_getFinalShape() is called.
-btTriangleIndexVertexArray *g_currentMesh;
-
-// These variables and the class below are used in player collision
-// detection. The callback is injected into the broadphase and keeps a
-// continuously updated list of what objects are colliding with the
-// player (in g_pairCache). This list is used in the function called
-// recoverFromPenetration().
-btHashedOverlappingPairCache* g_pairCache;
-CustomOverlappingPairCallback *g_customPairCallback;
-
-// Three physics modes: walking (with gravity and collision), flying
-// (collision but no gravity) and ghost mode (fly through walls)
-enum
-  {
-    PHYS_WALK,
-    PHYS_FLY,
-    PHYS_GHOST
-  };
-int g_physMode;
-
-// Include the player physics
-#include "cpp_player.cpp"
-
-// Include the uniform shape scaler
-#include "cpp_scale.cpp"
-
-class CustomOverlappingPairCallback : public btOverlappingPairCallback
-{
-public:
-  virtual btBroadphasePair* addOverlappingPair(btBroadphaseProxy* proxy0,
-                                               btBroadphaseProxy* proxy1)
-  {
-    if (proxy0->m_clientObject==g_playerObject ||
-        proxy1->m_clientObject==g_playerObject)
-      return g_pairCache->addOverlappingPair(proxy0,proxy1);
-    return 0;
-  }
-
-  virtual void* removeOverlappingPair(btBroadphaseProxy* proxy0,
-                                      btBroadphaseProxy* proxy1,
-                                      btDispatcher* dispatcher)
-  {
-    if (proxy0->m_clientObject==g_playerObject ||
-        proxy1->m_clientObject==g_playerObject)
-      return g_pairCache->removeOverlappingPair(proxy0,proxy1,dispatcher);
-
-    return 0;
-  }
-
-  void removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy0,
-                                             btDispatcher* dispatcher)
-  {    if (proxy0->m_clientObject==g_playerObject)
-      g_pairCache->removeOverlappingPairsContainingProxy(proxy0,dispatcher);
-  }
-};
-
-extern "C" int32_t bullet_init()
-{
-  // ------- SET UP THE WORLD -------
-
-  // Set up basic objects
-  g_collisionConfiguration = new btDefaultCollisionConfiguration();
-  g_dispatcher = new btCollisionDispatcher(g_collisionConfiguration);
-  //g_broadphase = new btDbvtBroadphase();
-  g_solver = new btSequentialImpulseConstraintSolver;
-
-  // TODO: Figure out what to do with this. We need the user callback
-  // function used below (I think), but this is only offered by this
-  // broadphase implementation (as far as I can see.) Maybe we can
-  // scan through the cell first and find good values that covers all
-  // the objects before we set up the dynamic world. Another option is
-  // to create a custom broadphase designed for our purpose. (We
-  // should probably use different ones for interior and exterior
-  // cells in any case.)
-  btVector3 worldMin(-20000,-20000,-20000);
-  btVector3 worldMax(20000,20000,20000);
-  g_broadphase = new btAxisSweep3(worldMin,worldMax);
-
-  g_dynamicsWorld =
-    new btDiscreteDynamicsWorld(g_dispatcher,
-                                g_broadphase,
-                                g_solver,
-                                g_collisionConfiguration);
-
-  //g_dynamicsWorld->setGravity(btVector3(0,-10,0));
-
-
-  // ------- SET UP THE PLAYER -------
-
-  // Create the player collision shape.
-  float width = 30;
-
-  /*
-  float height = 50;
-  btVector3 spherePositions[2];
-  btScalar sphereRadii[2];
-  sphereRadii[0] = width;
-  sphereRadii[1] = width;
-  spherePositions[0] = btVector3 (0,0,0);
-  spherePositions[1] = btVector3 (0,0,-height);
-
-  // One possible shape is the convex hull around two spheres
-  g_playerShape = new btMultiSphereShape(btVector3(width/2.0, height/2.0,
-                       width/2.0), &spherePositions[0], &sphereRadii[0], 2);
-  */
-
-  // Other posibilities - most are too slow, except the sphere
-  //g_playerShape = new btCylinderShapeZ(btVector3(width, width, height));
-  g_playerShape = new btSphereShape(width);
-  //g_playerShape = new btCapsuleShapeZ(width, height);
-
-  // Create the collision object
-  g_playerObject = new btCollisionObject ();
-  g_playerObject->setCollisionShape (g_playerShape);
-  g_playerObject->setCollisionFlags (btCollisionObject::CF_NO_CONTACT_RESPONSE);
-
-
-  // ------- OTHER STUFF -------
-
-  // Create a custom callback to pick out all the objects colliding
-  // with the player. We use this in the collision recovery phase.
-  g_pairCache = new btHashedOverlappingPairCache();
-  g_customPairCallback = new CustomOverlappingPairCallback();
-  g_broadphase->setOverlappingPairUserCallback(g_customPairCallback);
-
-  // Set up the callback that moves the player at the end of each
-  // simulation step.
-  g_dynamicsWorld->setInternalTickCallback(playerStepCallback);
-
-  // Add the character collision object to the world.
-  g_dynamicsWorld->addCollisionObject(g_playerObject,
-                                      MASK_PLAYER,
-                                      MASK_STATIC);
-
-  // Make sure these is zero at startup
-  g_currentMesh = NULL;
-
-  // Start out walking
-  g_physMode = PHYS_WALK;
-
-  // Success!
-  return 0;
-}
-
-// Set physics modes
-extern "C" void bullet_walk()
-{
-  g_physMode = PHYS_WALK;
-  cout << "Walk mode\n";
-}
-
-extern "C" void bullet_fly()
-{
-  g_physMode = PHYS_FLY;
-  cout << "Fly mode\n";
-}
-
-extern "C" void bullet_ghost()
-{
-  g_physMode = PHYS_GHOST;
-  cout << "Ghost mode\n";
-}
-
-// Switch to the next physics mode
-extern "C" void bullet_nextMode()
-{
-  switch(g_physMode)
-    {
-    case PHYS_WALK:
-      bullet_fly();
-      break;
-    case PHYS_FLY:
-      bullet_ghost();
-      break;
-    case PHYS_GHOST:
-      bullet_walk();
-      break;
-    }
-}
-
-// Warp the player to a specific location. We do not bother setting
-// rotation, since it's completely irrelevant for collision detection,
-// and doubly so since the collision mesh is a sphere.
-extern "C" void bullet_movePlayer(float x, float y, float z)
-{
-  btTransform tr;
-  tr.setIdentity();
-  tr.setOrigin(btVector3(x,y,z));
-  g_playerObject->setWorldTransform(tr);
-}
-
-// Request that the player moves in this direction
-extern "C" void bullet_setPlayerDir(float x, float y, float z)
-{ g_walkDirection.setValue(x,y,z); }
-
-// Get the current player position, after physics and collision have
-// been applied.
-extern "C" void bullet_getPlayerPos(float *x, float *y, float *z)
-{
-  *x = g_playerPosition.getX();
-  *y = g_playerPosition.getY();
-  *z = g_playerPosition.getZ();
-}
-
-void* copyBuffer(const void *buf, int elemSize, int len)
-{
-  int size = elemSize * len;
-  void *res = malloc(size);
-  memcpy(res, buf, size);
-
-  return res;
-}
-
-// Internal version that does not copy buffers
-void createTriShape(int32_t numFaces, const void *triArray,
-                    int32_t numVerts, const void *vertArray,
-                    const float *trans, const float *matrix)
-{
-  // This struct holds the index and vertex buffers of a single
-  // trimesh.
-  btIndexedMesh im;
-
-  // Set up the triangles
-  int numTriangles = numFaces / 3;
-  im.m_numTriangles = numTriangles;
-  im.m_triangleIndexStride = 6; // 3 indices * 2 bytes per short
-  im.m_triangleIndexBase = (unsigned char*)triArray;
-
-  // Set up the vertices
-  im.m_numVertices = numVerts;
-  im.m_vertexStride = 12; // 4 bytes per float * 3 floats per vertex
-  im.m_vertexBase = (unsigned char*)vertArray;
-
-  // Transform vertex values in vb according to 'trans' and 'matrix'
-  float *vb = (float*)im.m_vertexBase;
-  for(int i=0; i<numVerts; i++)
-    {
-      float x,y,z;
-
-      // Reinventing basic linear algebra for the win!
-      x = matrix[0]*vb[0]+matrix[1]*vb[1]+matrix[2]*vb[2] + trans[0];
-      y = matrix[3]*vb[0]+matrix[4]*vb[1]+matrix[5]*vb[2] + trans[1];
-      z = matrix[6]*vb[0]+matrix[7]*vb[1]+matrix[8]*vb[2] + trans[2];
-      *(vb++) = x;
-      *(vb++) = y;
-      *(vb++) = z;
-    }
-
-  // If no mesh is currently active, create one
-  if(g_currentMesh == NULL)
-    g_currentMesh = new btTriangleIndexVertexArray;
-
-  // Add the mesh. Nif data stores triangle indices as shorts.
-  g_currentMesh->addIndexedMesh(im, PHY_SHORT);
-}
-
-// Define a cube with coordinates 0,0,0 - 1,1,1.
-const float cube_verts[] =
-  {
-    0,0,0,   1,0,0,   0,1,0,
-    1,1,0,   0,0,1,   1,0,1,
-    0,1,1,   1,1,1
-  };
-
-// Triangles of the cube. The orientation of each triange doesn't
-// matter.
-const short cube_tris[] =
-  {
-    // bottom side
-    0, 1, 2,
-    1, 2, 3,
-    // top side
-    4, 5, 6,
-    5, 6, 7,
-    // front side
-    0, 4, 5,
-    0, 1, 5,
-    // back side
-    2, 3, 7,
-    2, 6, 7,
-    // left side
-    0, 2, 4,
-    2, 4, 6,
-    // right side
-    1, 3, 5,
-    3, 5, 7
-  };
-
-const int cube_num_verts = 8;
-const int cube_num_tris = 12;
-
-// Create a (trimesh) box with the given dimensions. Used for bounding
-// boxes. TODO: I guess we should use the NIF-specified bounding box
-// for this, not our automatically calculated one.
-extern "C" void bullet_createBoxShape(float xmin, float ymin, float zmin,
-                                      float xmax, float ymax, float zmax,
-                                      float *trans, float *matrix)
-{
-  // Make a copy of the vertex buffer, since we need to change it
-  float *vbuffer = (float*)copyBuffer(cube_verts, 12, cube_num_verts);
-
-  // Calculate the widths
-  float xwidth = xmax-xmin;
-  float ywidth = ymax-ymin;
-  float zwidth = zmax-zmin;
-
-  // Transform the cube to (xmin,xmax) etc
-  float *vb = vbuffer;
-  for(int i=0; i<cube_num_verts; i++)
-    {
-      *vb = (*vb)*xwidth + xmin; vb++;
-      *vb = (*vb)*ywidth + ymin; vb++;
-      *vb = (*vb)*zwidth + zmin; vb++;
-    }
-
-  // Insert the trimesh
-  createTriShape(cube_num_tris*3, cube_tris,
-                 cube_num_verts, vbuffer,
-                 trans, matrix);
-}
-
-// Create a triangle shape and insert it into the current index/vertex
-// array. If no array is active, create one.
-extern "C" void bullet_createTriShape(int32_t numFaces,
-                                      void *triArray,
-                                      int32_t numVerts,
-                                      void *vertArray,
-                                      float *trans,
-                                      float *matrix)
-{
-  createTriShape(numFaces, copyBuffer(triArray, 2, numFaces),
-                 numVerts, copyBuffer(vertArray, 12, numVerts),
-                 trans, matrix);
-}
-
-// Get the shape built up so far, if any. This clears g_currentMesh,
-// so the next call to createTriShape will start a new shape.
-extern "C" btCollisionShape *bullet_getFinalShape()
-{
-  btCollisionShape *shape;
-
-  // Create a shape from all the inserted completed meshes
-  shape = NULL;
-  if(g_currentMesh != NULL)
-    shape = new btBvhTriangleMeshShape(g_currentMesh, false);
-
-  // Clear these for the next NIF
-  g_currentMesh = NULL;
-  return shape;
-}
-
-// Insert a static mesh
-extern "C" void bullet_insertStatic(btConcaveShape *shape,
-                                    float *pos,
-                                    float *quat,
-                                    float scale)
-{
-  // FIXME: Scaling does NOT work.
-
-  // Are we scaled?
-  if(scale != 1.0)
-    {
-      //cout << "Scaling shape " << shape << " by " << scale << endl;
-
-      // Not quite sure how to handle local scaling yet. Our initial
-      // attempt was to create a wrapper that showed a scale mesh to
-      // the "outside world" while referencing the original, but I
-      // suspect it ended up altering the original data. At least it
-      // doesn't work the way it is now, and only crashes.
-
-      // The alternative is to create a new copy of the shape for each
-      // scaled version we insert. This is wasteful, but might be
-      // acceptable.
-
-      // It's also possible we can achieve this effect by changing
-      // larger parts of the Bullet library - but I hope I don't have
-      // to create my own dispatcher and such. Finally, even if the
-      // transformations given to objects are supposed to be uniform
-      // in length, maybe we can cheat the system and scale the
-      // transformation instead. Try it just for kicks, and go through
-      // the system to see what parts of Bullet it would break.
-
-      // In any case, when we find a solution we should apply it to
-      // all shapes (not just scale!=1.0) to get a better impression
-      // of any performance and memory overhead.
-
-      // Also, as an optimization, it looks like multiple instances of
-      // the same shape are often inserted with the same scale
-      // factor. We could easily cache this. The scale-recreation of
-      // meshes (in necessary) could be done as a separate function,
-      // and the caching could be done in D code.
-    }
-
-  btTransform trafo;
-  trafo.setIdentity();
-  trafo.setOrigin(btVector3(pos[0], pos[1], pos[2]));
-
-  // Ogre uses WXYZ quaternions, Bullet uses XYZW.
-  trafo.setRotation(btQuaternion(quat[1], quat[2], quat[3], quat[0]));
-
-  // Create and insert the collision object
-  btCollisionObject *obj = new btCollisionObject();
-  obj->setCollisionShape(shape);
-  obj->setWorldTransform(trafo);
-  g_dynamicsWorld->addCollisionObject(obj, MASK_STATIC, MASK_PLAYER);
-}
-
-// Move the physics simulation 'delta' seconds forward in time
-extern "C" void bullet_timeStep(float delta)
-{
-  TRACE("bullet_timeStep");
-  // TODO: We might experiment with the number of time steps. Remember
-  // that the function also returns the number of steps performed.
-  g_dynamicsWorld->stepSimulation(delta,2);
-}
-
-// Cleanup in the reverse order of creation/initialization
-extern "C" void bullet_cleanup()
-{
-  // Remove the rigidbodies from the dynamics world and delete them
-  for (int i=g_dynamicsWorld->getNumCollisionObjects()-1; i>=0 ;i--)
-    {
-      btCollisionObject* obj = g_dynamicsWorld->getCollisionObjectArray()[i];
-      btRigidBody* body = btRigidBody::upcast(obj);
-
-      if (body && body->getMotionState())
-        delete body->getMotionState();
-
-      g_dynamicsWorld->removeCollisionObject( obj );
-      delete obj;
-    }
-
-  delete g_dynamicsWorld;
-  delete g_solver;
-  delete g_broadphase;
-  delete g_dispatcher;
-  delete g_collisionConfiguration;
-}
diff --git a/old_d_version/bullet/cpp_player.cpp b/old_d_version/bullet/cpp_player.cpp
deleted file mode 100644
index 14b04bf84b..0000000000
--- a/old_d_version/bullet/cpp_player.cpp
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-  (see additional copyrights for this file below)
-
-  This file (cpp_player.cpp) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
-  ----
-
-  Parts of this file is based on the kinematic character controller
-  demo included with the Bullet library. The copyright statement for
-  these parts follow:
-
-  Bullet Continuous Collision Detection and Physics Library
-  Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any
-  damages arising from the use of this software.  Permission is
-  granted to anyone to use this software for any purpose, including
-  commercial applications, and to alter it and redistribute it freely,
-  subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must
-     not claim that you wrote the original software. If you use this
-     software in a product, an acknowledgment in the product
-     documentation would be appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must
-     not be misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source
-     distribution.
-*/
-
-
-// This file handles player-specific physics and collision detection
-
-// TODO: Later we might handle various physics modes, eg. dynamic
-// (full physics), player_walk, player_fall, player_swim,
-// player_float, player_levitate, player_ghost. These would be
-// applicable to any object (through Monster script), allowing the
-// physics code to be shared between NPCs, creatures and the player.
-
-// Variables used internally in this file. Once we make per-object
-// player collision, these will be member variables.
-bool g_touchingContact;
-btVector3 g_touchingNormal;
-btScalar g_currentStepOffset;
-float g_stepHeight = 5;
-
-// Returns the reflection direction of a ray going 'direction' hitting
-// a surface with normal 'normal'
-btVector3 reflect (const btVector3& direction, const btVector3& normal)
-{ return direction - (btScalar(2.0) * direction.dot(normal)) * normal; }
-
-// Returns the portion of 'direction' that is perpendicular to
-// 'normal'
-btVector3 perpComponent (const btVector3& direction, const btVector3& normal)
-{ return direction - normal * direction.dot(normal); }
-
-btManifoldArray manifoldArray;
-
-// Callback used for collision detection sweep tests. It prevents self
-// collision and is used in calls to convexSweepTest(). TODO: It might
-// be enough to just set the filters on this. If we set the group and
-// mask so that we only collide with static objects, self collision
-// would never happen. The sweep test function should have had a
-// version where you only specify the filters - I might add that
-// myself.
-class ClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConvexResultCallback
-{
-public:
-  ClosestNotMeConvexResultCallback()
-    : btCollisionWorld::ClosestConvexResultCallback
-      (btVector3(0.0, 0.0, 0.0), btVector3(0.0, 0.0, 0.0))
-  {
-    m_collisionFilterGroup = g_playerObject->
-      getBroadphaseHandle()->m_collisionFilterGroup;
-
-    m_collisionFilterMask = g_playerObject->
-      getBroadphaseHandle()->m_collisionFilterMask;
-  }
-
-  btScalar addSingleResult(btCollisionWorld::LocalConvexResult&
-                           convexResult, bool normalInWorldSpace)
-  {
-    if (convexResult.m_hitCollisionObject == g_playerObject) return 1.0;
-
-    return ClosestConvexResultCallback::addSingleResult
-      (convexResult, normalInWorldSpace);
-  }
-};
-
-// Used to step up small steps and slopes.
-void stepUp()
-{
-  // phase 1: up
-  btVector3 targetPosition = g_playerPosition +
-    btVector3(0.0, 0.0, g_stepHeight);
-  btTransform start, end;
-
-  start.setIdentity ();
-  end.setIdentity ();
-
-  // FIXME: Handle penetration properly
-  start.setOrigin (g_playerPosition + btVector3(0.0, 0.1, 0.0));
-  end.setOrigin (targetPosition);
-
-  ClosestNotMeConvexResultCallback callback;
-  g_dynamicsWorld->convexSweepTest (g_playerShape, start, end, callback);
-
-  if (callback.hasHit())
-    {
-      // we moved up only a fraction of the step height
-      g_currentStepOffset = g_stepHeight * callback.m_closestHitFraction;
-      g_playerPosition.setInterpolate3(g_playerPosition, targetPosition,
-                                       callback.m_closestHitFraction);
-    }
-  else
-    {
-      g_currentStepOffset = g_stepHeight;
-      g_playerPosition = targetPosition;
-    }
-}
-
-void updateTargetPositionBasedOnCollision (const btVector3& hitNormal,
-                                           btVector3 &targetPosition)
-{
-  btVector3 movementDirection = targetPosition - g_playerPosition;
-  btScalar movementLength = movementDirection.length();
-
-  if (movementLength <= SIMD_EPSILON)
-    return;
-
-  // Is this needed?
-  movementDirection.normalize();
-
-  btVector3 reflectDir = reflect(movementDirection, hitNormal);
-  reflectDir.normalize();
-
-  btVector3 perpendicularDir = perpComponent (reflectDir, hitNormal);
-
-  targetPosition = g_playerPosition;
-  targetPosition += perpendicularDir * movementLength;
-}
-
-// This covers all normal forward movement and collision, including
-// walking sideways when hitting a wall at an angle. It does NOT
-// handle walking up slopes and steps, or falling/gravity.
-void stepForward(btVector3& walkMove)
-{
-  btVector3 originalDir = walkMove.normalized();
-
-  // If no walking direction is given, we still run the function. This
-  // allows moving forces to push the player around even if she is
-  // standing still.
-  if (walkMove.length() < SIMD_EPSILON)
-    originalDir.setValue(0.f,0.f,0.f);
-
-  btTransform start, end;
-  btVector3 targetPosition = g_playerPosition + walkMove;
-  start.setIdentity ();
-  end.setIdentity ();
-	
-  btScalar fraction = 1.0;
-  btScalar distance2 = (g_playerPosition-targetPosition).length2();
-
-  if (g_touchingContact)
-    if (originalDir.dot(g_touchingNormal) > btScalar(0.0))
-      updateTargetPositionBasedOnCollision (g_touchingNormal, targetPosition);
-
-  int maxIter = 10;
-
-  while (fraction > btScalar(0.01) && maxIter-- > 0)
-    {
-      start.setOrigin (g_playerPosition);
-      end.setOrigin (targetPosition);
-
-      ClosestNotMeConvexResultCallback callback;
-      g_dynamicsWorld->convexSweepTest (g_playerShape, start, end, callback);
-		
-      fraction -= callback.m_closestHitFraction;
-
-      if (callback.hasHit())
-        {	
-          // We moved only a fraction
-          btScalar hitDistance = (callback.m_hitPointWorld - g_playerPosition).length();
-          // If the distance is further than the collision margin,
-          // move
-          if (hitDistance > 0.05)
-            g_playerPosition.setInterpolate3(g_playerPosition, targetPosition,
-                                             callback.m_closestHitFraction);
-
-          updateTargetPositionBasedOnCollision(callback.m_hitNormalWorld,
-                                               targetPosition);
-          btVector3 currentDir = targetPosition - g_playerPosition;
-          distance2 = currentDir.length2();
-
-          if (distance2 <= SIMD_EPSILON)
-            break;
-
-          currentDir.normalize();
-
-          if (currentDir.dot(originalDir) <= btScalar(0.0))
-            break;
-        }
-      else
-        // we moved the whole way
-        g_playerPosition = targetPosition;
-    }
-}
-
-void stepDown (btScalar dt)
-{
-  btTransform start, end;
-
-  // phase 3: down
-  btVector3 step_drop = btVector3(0,0,g_currentStepOffset);
-  btVector3 gravity_drop = btVector3(0,0,g_stepHeight);
-
-  btVector3 targetPosition = g_playerPosition - step_drop - gravity_drop;
-
-  start.setIdentity ();
-  end.setIdentity ();
-
-  start.setOrigin (g_playerPosition);
-  end.setOrigin (targetPosition);
-
-  ClosestNotMeConvexResultCallback callback;
-  g_dynamicsWorld->convexSweepTest(g_playerShape, start, end, callback);
-
-  if (callback.hasHit())
-    // we dropped a fraction of the height -> hit floor
-    g_playerPosition.setInterpolate3(g_playerPosition, targetPosition,
-                                     callback.m_closestHitFraction);
-  else
-    // we dropped the full height
-    g_playerPosition = targetPosition;
-}
-
-// Check if the player currently collides with anything, and adjust
-// its position accordingly. Returns true if collisions were found.
-bool recoverFromPenetration()
-{
-  bool penetration = false;
-
-  // Update the collision pair cache
-  g_dispatcher->dispatchAllCollisionPairs(g_pairCache,
-                                          g_dynamicsWorld->getDispatchInfo(),
-                                          g_dispatcher);
-
-  btScalar maxPen = 0.0;
-  for (int i = 0; i < g_pairCache->getNumOverlappingPairs(); i++)
-    {
-      manifoldArray.resize(0);
-
-      btBroadphasePair* collisionPair = &g_pairCache->getOverlappingPairArray()[i];
-      // Get the contact points
-      if (collisionPair->m_algorithm)
-        collisionPair->m_algorithm->getAllContactManifolds(manifoldArray);
-
-      // And handle them
-      for (int j=0;j<manifoldArray.size();j++)
-        {
-          btPersistentManifold* manifold = manifoldArray[j];
-          btScalar directionSign = manifold->getBody0() ==
-            g_playerObject ? btScalar(-1.0) : btScalar(1.0);
-
-          for (int p=0;p<manifold->getNumContacts();p++)
-            {
-              const btManifoldPoint &pt = manifold->getContactPoint(p);
-
-              if (pt.getDistance() < 0.0)
-                {
-                  // Pick out the maximum penetration normal and store
-                  // it
-                  if (pt.getDistance() < maxPen)
-                    {
-                      maxPen = pt.getDistance();
-                      g_touchingNormal = pt.m_normalWorldOnB * directionSign;//??
-
-                    }
-                  g_playerPosition += pt.m_normalWorldOnB * directionSign *
-                    pt.getDistance() * btScalar(0.2);
-
-                  penetration = true;
-                }
-            }
-        }
-    }
-
-  btTransform newTrans = g_playerObject->getWorldTransform();
-  newTrans.setOrigin(g_playerPosition);
-  g_playerObject->setWorldTransform(newTrans);
-
-  return penetration;
-}
-
-// Callback called at the end of each simulation cycle. This is the
-// main function is responsible for player movement.
-void playerStepCallback(btDynamicsWorld* dynamicsWorld, btScalar timeStep)
-{
-  // The walking direction is set from D code each frame, and the
-  // final player position is read back from D code after the
-  // simulation.
-  btVector3 walkStep = g_walkDirection * timeStep;
-
-  float len = walkStep.length();
-
-  // In walk mode, it shouldn't matter whether or not we look up or
-  // down. Rotate the vector back to the horizontal plane.
-  if(g_physMode == PHYS_WALK)
-    {
-      walkStep.setZ(0);
-      float len2 = walkStep.length();
-      if(len2 > 0)
-        walkStep *= len/len2;
-    }
-
-  // Get the player position
-  g_playerPosition = g_playerObject->getWorldTransform().getOrigin();
-
-  if(g_physMode == PHYS_GHOST)
-    {
-      // Ghost mode - just move, no collision
-      g_playerPosition += walkStep;
-    }
-  else
-    {
-      // Collision detection is active
-
-      // Before moving, recover from current penetrations
-      int numPenetrationLoops = 0;
-      g_touchingContact = false;
-      while (recoverFromPenetration())
-        {
-          numPenetrationLoops++;
-          g_touchingContact = true;
-
-          // Make sure we don't stay here indefinitely
-          if (numPenetrationLoops > 4)
-            break;
-        }
-
-      // recoverFromPenetration updates g_playerPosition and the
-      // collision mesh, so they are still in sync at this point
-
-      // Next, do the walk. The following functions only updates
-      // g_playerPosition, they do not move the collision object.
-
-      if(g_physMode == PHYS_WALK)
-        {
-          stepUp();
-          stepForward(walkStep);
-          stepDown(timeStep);
-        }
-      else if(g_physMode == PHYS_FLY)
-        stepForward(walkStep);
-      else
-        cout << "WARNING: Unknown physics mode " << g_physMode << "!\n";
-    }
-
-  // Move the player collision mesh
-  btTransform xform = g_playerObject->getWorldTransform ();
-  xform.setOrigin (g_playerPosition);
-  g_playerObject->setWorldTransform (xform);
-}
diff --git a/old_d_version/bullet/cpp_scale.cpp b/old_d_version/bullet/cpp_scale.cpp
deleted file mode 100644
index 3dfd34a305..0000000000
--- a/old_d_version/bullet/cpp_scale.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (cpp_scale.cpp) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
-*/
-
-// WARNING: This file does NOT work, and it is not used yet.
-
-class ScaleCallback : public btTriangleCallback
-{
-  btTriangleCallback *call;
-  float factor;
-
-public:
-  ScaleCallback(btTriangleCallback *c, float f)
-  { call = c; factor = f; }
-
-  void processTriangle(btVector3 *tri, int partid, int triindex)
-  {
-    btVector3 vecs[3];
-    vecs[0] = tri[0]*factor;
-    vecs[1] = tri[1]*factor;
-    vecs[2] = tri[2]*factor;
-
-    call->processTriangle(vecs, partid, triindex);
-  }
-};
-
-// This class is used to uniformly scale a triangle mesh by a
-// factor. It wraps around an existing shape and does not copy the
-// data.
-class ScaleShape : public btConcaveShape
-{
-  btConcaveShape* child;
-  float factor, fact3, facthalf;
-	
-public:
-
-  ScaleShape(btConcaveShape* ch, float ft)
-  {
-    child = ch;
-    factor = ft;
-    fact3 = factor*factor*factor;
-    facthalf = factor*0.5;
-  }
-
-  void calculateLocalInertia(btScalar mass,btVector3& inertia) const
-  {
-    btVector3 tmpInertia;
-    child->calculateLocalInertia(mass,tmpInertia);
-    inertia = tmpInertia * fact3;
-  }
-
-  const char* getName()const { return "ScaleShape"; }
-
-  void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-  {
-    child->getAabb(t,aabbMin,aabbMax);
-    btVector3 aabbCenter = (aabbMax+aabbMin)*0.5;
-    btVector3 scaledAabbHalfExtends = (aabbMax-aabbMin)*facthalf;
-
-    aabbMin = aabbCenter - scaledAabbHalfExtends;
-    aabbMax = aabbCenter + scaledAabbHalfExtends;
-  }
-
-  void processAllTriangles(btTriangleCallback *callback,const btVector3& aabbMin,const btVector3& aabbMax) const
-  {
-    ScaleCallback scb(callback, factor);
-
-    child->processAllTriangles(&scb, aabbMin, aabbMax);
-  }
-
-  void setLocalScaling(const btVector3& scaling)
-  { child->setLocalScaling(scaling); }
-
-  const btVector3& getLocalScaling() const
-  { return child->getLocalScaling(); }
-
-  int getShapeType() const
-  { return TRIANGLE_MESH_SHAPE_PROXYTYPE; }
-};
diff --git a/old_d_version/core/config.d b/old_d_version/core/config.d
deleted file mode 100644
index 55daa2be15..0000000000
--- a/old_d_version/core/config.d
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (config.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module core.config;
-
-import std.string;
-import std.file;
-import std.path;
-import std.stdio;
-
-import monster.monster;
-import monster.util.string;
-
-import core.inifile;
-import core.filefinder;
-
-import sound.audio;
-
-import input.keys;
-import input.ois;
-
-import ogre.ogre;
-
-ConfigManager config;
-
-/*
- * Structure that handles all user adjustable configuration options,
- * including things like file paths, plugins, graphics resolution,
- * game settings, window positions, etc. It is also responsible for
- * reading and writing configuration files, for importing settings
- * from Morrowind.ini and for configuring OGRE. It doesn't currently
- * DO all of this, but it is supposed to in the future.
- */
-
-struct ConfigManager
-{
-  MonsterObject *mo;
-
-  IniWriter iniWriter;
-
-  // Mouse sensitivity
-  float *mouseSensX;
-  float *mouseSensY;
-  bool *flipMouseY;
-
-  // Ogre configuration
-  bool showOgreConfig; // The configuration setting
-  // The actual result, overridable by a command line switch, and also
-  // set to true if firstRun is true.
-  bool finalOgreConfig;
-
-  // Other settings
-  bool firstRun;
-
-  // Set to true if sound is completely disabled
-  bool noSound = false;
-
-  // Number of current screen shot. Saved upon exit, so that shots
-  // from separate sessions don't overwrite each other.
-  int screenShotNum;
-
-  // Game files to load (max 255)
-  char[][] gameFiles;
-
-  // Directories
-  char[] dataDir;
-  char[] esmDir;
-  char[] bsaDir;
-  char[] sndDir;
-  char[] fontDir;
-  char[] musDir; // Explore music
-  char[] musDir2; // Battle music
-
-  // Configuration file
-  char[] confFile = "openmw.ini";
-
-  // Cell to load at startup
-  char[] defaultCell;
-
-  // These set the volume to a new value and updates all sounds to
-  // take notice.
-  void setMusicVolume(float vol)
-  {
-    stack.pushFloat(vol);
-    mo.call("setMusicVolume");
-  }
-  float getMusicVolume()
-  { return mo.getFloat("musicVolume"); }
-
-  void setSfxVolume(float vol)
-  {
-    stack.pushFloat(vol);
-    mo.call("setSfxVolume");
-  }
-  float getSfxVolume()
-  { return mo.getFloat("sfxVolume"); }
-
-  void setMainVolume(float vol)
-  {
-    stack.pushFloat(vol);
-    mo.call("setMainVolume");
-  }
-  float getMainVolume()
-  { return mo.getFloat("mainVolume"); }
-
-  // Initialize the config manager. Send a 'true' parameter to reset
-  // all keybindings to the default. A lot of this stuff will be moved
-  // to script code at some point. In general, all input mechanics and
-  // distribution of key events should happen in native code, while
-  // all setup and control should be handled in script code.
-  void initialize(bool reset = false)
-  {
-    // Initialize variables from Monster.
-    assert(mo !is null);
-    mouseSensX = mo.getFloatPtr("mouseSensX");
-    mouseSensY = mo.getFloatPtr("mouseSensY");
-    flipMouseY = mo.getBoolPtr("flipMouseY");
-
-    // Initialize the key binding manager
-    keyBindings.initKeys();
-
-    /* Disable this at the moment. It's a good idea to put
-       configuration in a central location, but it's useless as long
-       as Ogre expects to find it's files in the current working
-       directory. The best permanent solution would be to let the
-       locations of ogre.cfg and plugins.cfg be determined by
-       openmw.ini - I will fix that later.
-
-    version(Posix)
-      {
-        if(!exists(confFile))
-          confFile = expandTilde("~/.openmw/openmw.ini");
-      }
-    */
-
-    readIni(reset);
-  }
-
-  // Read config from morro.ini, if it exists. The reset parameter is
-  // set to true if we should use default key bindings instead of the
-  // ones from the config file.
-  void readIni(bool reset)
-  {
-    // Read configuration file, if it exists.
-    IniReader ini;
-
-    ini.readFile(confFile);
-
-    screenShotNum = ini.getInt("General", "Screenshots", 0);
-    float mainVolume = saneVol(ini.getFloat("Sound", "Main Volume", 0.7));
-    float musicVolume = saneVol(ini.getFloat("Sound", "Music Volume", 0.5));
-    float sfxVolume = saneVol(ini.getFloat("Sound", "SFX Volume", 0.5));
-    bool useMusic = ini.getBool("Sound", "Enable Music", true);
-
-
-    lightConst = ini.getInt("LightAttenuation", "UseConstant", 0);
-    lightConstValue = ini.getFloat("LightAttenuation", "ConstantValue", 0.0);
-
-    lightLinear = ini.getInt("LightAttenuation", "UseLinear", 1);
-    lightLinearMethod = ini.getInt("LightAttenuation", "LinearMethod", 1);
-    lightLinearValue = ini.getFloat("LightAttenuation", "LinearValue", 3.0);
-    lightLinearRadiusMult = ini.getFloat("LightAttenuation", "LinearRadiusMult", 1.0);
-
-    lightQuadratic = ini.getInt("LightAttenuation", "UseQuadratic", 0);
-    lightQuadraticMethod = ini.getInt("LightAttenuation", "QuadraticMethod", 2);
-    lightQuadraticValue = ini.getFloat("LightAttenuation", "QuadraticValue", 16.0);
-    lightQuadraticRadiusMult = ini.getFloat("LightAttenuation", "QuadraticRadiusMult", 1.0);
-
-    lightOutQuadInLin = ini.getInt("LightAttenuation", "OutQuadInLin", 0);
-
-
-    *mouseSensX = ini.getFloat("Controls", "Mouse Sensitivity X", 0.2);
-    *mouseSensY = ini.getFloat("Controls", "Mouse Sensitivity Y", 0.2);
-    *flipMouseY = ini.getBool("Controls", "Flip Mouse Y Axis", false);
-
-    mo.setFloat("mainVolume", mainVolume);
-    mo.setFloat("musicVolume", musicVolume);
-    mo.setFloat("sfxVolume", sfxVolume);
-    mo.setBool("useMusic", useMusic);
-
-    defaultCell = ini.getString("General", "Default Cell", "Assu");
-
-    firstRun = ini.getBool("General", "First Run", true);
-    showOgreConfig = ini.getBool("General", "Show Ogre Config", false);
-
-    // This flag determines whether we will actually show the Ogre
-    // config dialogue. The EITHER of the following are true, the
-    // config box will be shown:
-    // - The program is being run for the first time
-    // - The "Show Ogre Config" option in openmw.ini is set.
-    // - The -oc option is specified on the command line
-    // - The file ogre.cfg is missing
-
-    finalOgreConfig = showOgreConfig || firstRun ||
-                      !exists("ogre.cfg");
-
-    // Set default key bindings first.
-    with(keyBindings)
-      {
-	// Bind some default keys
-	bind(Keys.MoveLeft, KC.A, KC.LEFT);
-	bind(Keys.MoveRight, KC.D, KC.RIGHT);
-	bind(Keys.MoveForward, KC.W, KC.UP);
-	bind(Keys.MoveBackward, KC.S, KC.DOWN);
-	bind(Keys.MoveUp, KC.LSHIFT);
-	bind(Keys.MoveDown, KC.LCONTROL);
-
-	bind(Keys.MainVolUp, KC.ADD);
-	bind(Keys.MainVolDown, KC.SUBTRACT);
-	bind(Keys.MusVolDown, KC.N1);
-	bind(Keys.MusVolUp, KC.N2);
-	bind(Keys.SfxVolDown, KC.N3);
-	bind(Keys.SfxVolUp, KC.N4);
-        bind(Keys.Mute, KC.M);
-
-        bind(Keys.Fullscreen, KC.F);
-
-	bind(Keys.ToggleBattleMusic, KC.SPACE);
-        bind(Keys.PhysMode, KC.T);
-        bind(Keys.Nighteye, KC.N);
-        bind(Keys.ToggleGui, KC.Mouse1);
-        bind(Keys.Console, KC.F1, KC.GRAVE);
-        bind(Keys.Debug, KC.G);
-
-	bind(Keys.Pause, KC.PAUSE, KC.P);
-	bind(Keys.ScreenShot, KC.SYSRQ);
-	bind(Keys.Exit, KC.Q, KC.ESCAPE);
-      }
-
-    // Unless the ini file was missing or we were asked to reset all
-    // keybindings to default, replace all present bindings with the
-    // values from the ini.
-    if(!reset && ini.wasRead)
-      {
-        // Read key bindings
-        for(int i; i<Keys.Length; i++)
-          {
-            char[] s = keyToString[i];
-            if(s.length)
-              {
-                char[] iniVal = ini.getString("Bindings", s, "_def");
-
-                // Was the setting present in the ini file?
-                if(iniVal != "_def")
-                  // If so, bind it!
-                  keyBindings.bindComma(cast(Keys)i, iniVal);
-              }
-          }
-      }
-
-    // Read data file directory
-    dataDir = ini.getString("General", "Data Directory", "data/");
-
-    // Make sure there's a trailing slash at the end. The forward slash
-    // / works on all platforms, while the backslash \ does not. This
-    // isn't super robust, but we will fix a general path handle
-    // mechanism later (or use an existing one.)
-    if(dataDir.ends("\\")) dataDir[$-1] = '/';
-    if(!dataDir.ends("/")) dataDir ~= '/';
-
-    bsaDir = dataDir;
-    esmDir = dataDir;
-    sndDir = dataDir ~ "Sound/";
-    fontDir = dataDir ~ "Fonts/";
-    musDir = dataDir ~ "Music/Explore/";
-    musDir2 = dataDir ~ "Music/Battle/";
-
-    // A maximum of 255 game files are allowed. Search the whole range
-    // in case some holes developed in the number sequence. This isn't
-    // a great way of specifying files (it's just a copy of the flawed
-    // model that Morrowind uses), but it will do for the time being.
-    FileFinder srch = new FileFinder(esmDir, null, Recurse.No);
-    for(int i = 0;i < 255;i++)
-      {
-        char[] s = ini.getString("Game Files", format("GameFile[%d]",i), null);
-        if(s != null && srch.has(s))
-          gameFiles ~= esmDir ~ s;
-      }
-    delete srch;
-
-    if(gameFiles.length == 0)
-      {
-        // No game files set. Look in the esmDir for Morrowind.esm.
-        // We can add Tribunal.esm, and Bloodmoon.esm as defaults too
-        // later, when we're out of testing mode.
-        char[][] baseFiles = ["Morrowind.esm"];
-        //char[][] baseFiles = ["Morrowind.esm","Tribunal.esm","Bloodmoon.esm"];
-        srch = new FileFinder(esmDir, "esm", Recurse.No);
-
-        foreach(ref s; baseFiles)
-          {
-            if(srch.has(s))
-              {
-                writefln("Adding game file %s", s);
-                gameFiles ~= esmDir ~ s;
-              }
-          }
-        delete srch;
-      }
-
-    // FIXME: Must sort gameFiles so that ESMs come first, then ESPs.
-    // I don't know if this needs to be done by filename, or by the
-    // actual file type..
-    // Further sort the two groups by file date (oldest first).
-
-    /* Don't bother reading every directory seperately
-    bsaDir = ini.getString("General", "BSA Directory", "data/");
-    esmDir = ini.getString("General", "ESM Directory", "data/");
-    sndDir = ini.getString("General", "SFX Directory", "data/Sound/");
-    musDir = ini.getString("General", "Explore Music Directory", "data/Music/Explore/");
-    musDir2 = ini.getString("General", "Battle Music Directory", "data/Music/Battle/");
-    */
-  }
-
-  // Create the config file
-  void writeConfig()
-  {
-    //writefln("writeConfig(%s)", confFile);
-    with(iniWriter)
-      {
-	openFile(confFile);
-
-	comment("Don't write your own comments in this file, they");
-	comment("will disappear when the file is rewritten.");
-	section("General");
-	writeString("Data Directory", dataDir);
-	/*
-	writeString("ESM Directory", esmDir);
-	writeString("BSA Directory", bsaDir);
-	writeString("SFX Directory", sndDir);
-	writeString("Explore Music Directory", musDir);
-	writeString("Battle Music Directory", musDir2);
-	*/
-	writeInt("Screenshots", screenShotNum);
-	writeString("Default Cell", defaultCell);
-
-        // Save the setting as it appeared in the input. The setting
-        // you specify in the ini is persistent, specifying the -oc
-        // parameter does not change it.
-        writeBool("Show Ogre Config", showOgreConfig);
-
-        // The next run is never the first run.
-        writeBool("First Run", false);
-
-	section("Controls");
-	writeFloat("Mouse Sensitivity X", *mouseSensX);
-	writeFloat("Mouse Sensitivity Y", *mouseSensY);
-	writeBool("Flip Mouse Y Axis", *flipMouseY);
-
-	section("Bindings");
-	comment("Key bindings. The strings must match exactly.");
-	foreach(int i, KeyBind b; keyBindings.bindings)
-	  {
-	    char[] s = keyToString[i];
-	    if(s.length)
-	      writeString(s, b.getString());
-	  }
-
-	section("Sound");
-	writeFloat("Main Volume", mo.getFloat("mainVolume"));
-	writeFloat("Music Volume", mo.getFloat("musicVolume"));
-	writeFloat("SFX Volume", mo.getFloat("sfxVolume"));
-	writeBool("Enable Music", mo.getBool("useMusic"));
-
-	section("LightAttenuation");
-    comment("For constant attenuation");
-	writeInt("UseConstant", lightConst);
-	writeFloat("ConstantValue", lightConstValue);
-    comment("For linear attenuation");
-	writeInt("UseLinear", lightLinear);
-	writeInt("LinearMethod", lightLinearMethod);
-	writeFloat("LinearValue", lightLinearValue);
-	writeFloat("LinearRadiusMult", lightLinearRadiusMult);
-    comment("For quadratic attenuation");
-	writeInt("UseQuadratic", lightQuadratic);
-	writeInt("QuadraticMethod", lightQuadraticMethod);
-	writeFloat("QuadraticValue", lightQuadraticValue);
-	writeFloat("QuadraticRadiusMult", lightQuadraticRadiusMult);
-    comment("For quadratic in exteriors and linear in interiors");
-	writeInt("OutQuadInLin", lightOutQuadInLin);
-
-	section("Game Files");
-	foreach(int i, ref s; gameFiles)
-	  writeString(format("GameFile[%d]",i), s[esmDir.length..$]);
-
-	close();
-      }
-  }
-
-  // In the future this will import settings from Morrowind.ini, as
-  // far as this is sensible.
-  void importIni()
-  {
-    /*
-    IniReader ini;
-    ini.readFile("../Morrowind.ini");
-
-    // Example of sensible options to convert:
-
-    tryArchiveFirst = ini.getInt("General", "TryArchiveFirst");
-    useAudio = ( ini.getInt("General", "Disable Audio") == 0 );
-    footStepVolume = ini.getFloat("General", "PC Footstep Volume");
-    subtitles = ini.getInt("General", "Subtitles") == 1;
-
-    The plugin list (all esm and esp files) would be handled a bit
-    differently. In our system they might be a per-user (per
-    "character") setting, or even per-savegame. It should be safe and
-    intuitive to try out a new mod without risking your savegame data
-    or original settings. So these would be handled in a separate
-    plugin manager.
-
-    In any case, the import should be interactive and user-driven, so
-    there is no use in making it before we have a gui of some sort up
-    and running.
-    */
-  }
-}
diff --git a/old_d_version/core/filefinder.d b/old_d_version/core/filefinder.d
deleted file mode 100644
index 91901b546c..0000000000
--- a/old_d_version/core/filefinder.d
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (filefinder.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module core.filefinder;
-
-import std.file;
-import std.string;
-
-import monster.util.string;
-import monster.util.aa;
-
-import core.memory;
-
-import std.stdio;
-
-class FileFinderException : Exception
-{
-  this(char[] msg, char[] ext, char[] dir)
-    {
-      if(ext.length) super(format("FileFinder for %s files in %s: %s", ext, dir, msg));
-      else super(format("FileFinder for %s: %s", dir, msg));
-    }
-}
-
-// Do we traverse directories recursively? Default is yes.
-enum Recurse { Yes, No }
-
-// The file finder is used to list all files in a directory so we can
-// look up files without searching the filesystem each time. It is
-// case insensitive on all platforms, and transparently converts to
-// the right directory separator character (\ or /). We might extend
-// it later with code from other projects.
-class FileFinder
-{
-  private:
-  char[][] files; // Use GC for this, it's not too big and we don't
-		  // have to manage roots pointing to the filenames.
-  HashTable!(char[], int, ESMRegionAlloc, FilenameHasher) lookup;
-
-  char[] dir; // Base directory to search
-  char[] ext; // Extensions to pick out
-
-  void fail(char[] err)
-    {
-      throw new FileFinderException(err, ext, dir);
-    }
-
-  // Removes the part of a path that is stored in 'dir'
-  char[] removeDir(char[] path)
-    {
-      //TODO: Should this be case insensitive?
-      assert(path[0..dir.length] == dir);
-
-      return path[dir.length..$];
-    }
-
-  void insert(char[] filename)
-    {
-      // Only keep the part of the filename not given in 'dir'.
-      char[] name = removeDir(filename);
-
-      if(!name.iEnds(ext)) return;
-
-      // We start counting from 1
-      uint newVal = files.length+1;
-
-      // Insert it, or get the old value if it already exists
-      uint oldVal = lookup[name, newVal];
-      if(oldVal != newVal)
-	fail("Already have " ~ name ~ "\nPreviously inserted as " ~ files[oldVal-1]);
-
-      // Store it
-      files ~= filename;
-    }
-
- public:
-
-  static char[] addSlash(char[] dir)
-    {
-      // Add a trailing slash
-      version(Windows) if(!dir.ends("\\")) dir ~= '\\';
-      version(Posix) if(!dir.ends("/")) dir ~= '/';
-      return dir;
-    }
-
-  int length() { return lookup.length; }
-
-  this(char[] dir, char[] ext = null, Recurse r = Recurse.Yes)
-    in
-    { 
-      if(!dir.length) fail("'dir' can not be empty");
-    }
-    out
-    {
-      assert(files.length == lookup.length);
-    }
-    body
-    {
-      // Add a trailing slash
-      dir = addSlash(dir);
-
-      this.dir = dir;
-
-      if(ext.length && ext[0] != '.') ext = "." ~ ext;
-      this.ext = ext;
-
-      bool callback(DirEntry* de)
-	{
-	  if (de.isdir)
-	    {
-	      if(r == Recurse.Yes)
-		listdir(de.name, &callback);
-	    }
-	  else
-	    insert(de.name);
-	  return true;
-	}
-
-      try listdir(dir, &callback);
-      catch(FileException e)
-	fail(e.toString);
-    }
-
-  char[] opIndex(int i) { return files[i-1]; }
-
-  int opIndex(char[] file)
-    {
-      int i;
-
-      // Get value if it exists
-      if(lookup.inList(file, i))
-	return i;
-      return 0;
-    }
-
-  bool has(char[] file)
-    {
-      return lookup.inList(file);
-    }
-
-  int opApply(int delegate(ref char[]) del)
-    {
-      int res = 0;
-
-      foreach(char[] s; files)
-	{
-	  char[] tmp = removeDir(s);
-	  res = del(tmp);
-	  if(res) break;
-	}
-      return res;
-    }
-
-  char[] toString()
-    {
-      char[] result;
-      foreach(char[] s; this)
-	result ~= s ~ "\n";
-      return result;
-    }
-}
-
-// Hash functions that does not differentiate between linux and
-// windows file names. This means that it is case insensitive, and
-// treats '\' and '/' as the same character. Only needed in linux, in
-// windows just use CITextHasher.
-version(Posix)
-struct FilenameHasher
-{
-  static const char conv = 'a'-'A';
-
-  static int isEqual(char[] aa, char[] bb)
-  {
-    if(aa.length != bb.length) return 0;
-
-    foreach(int i, char a; aa)
-      {
-	char b = bb[i];
-
-	if(a == b)
-	  continue;
-
-	// Convert both to lowercase and "/ case"
-	if(a <= 'Z' && a >= 'A') a += conv;
-	else if(a == '\\') a = '/';
-	if(b <= 'Z' && b >= 'A') b += conv;
-	else if(b == '\\') b = '/';
-
-	if(a != b) return 0;
-      }
-
-    // No differences were found
-    return 1;
-  }
-
-  static uint hash(char[] s)
-  {
-    uint hash;
-    foreach (char c; s)
-      {
-	if(c <= 'Z' && c >= 'A') c += conv;
-	else if(c == '\\') c = '/';
-	hash = (hash * 37) + c;
-      }
-    return hash;
-  }
-}
-
-version(Windows) alias CITextHash FilenameHasher;
diff --git a/old_d_version/esm/defs.d b/old_d_version/esm/defs.d
deleted file mode 100644
index 337db02fc3..0000000000
--- a/old_d_version/esm/defs.d
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (defs.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module esm.defs;
-
-public import std.string;
-public import monster.util.string;
-import monster.monster;
-
-/*
- *  Types and definitions related to parsing esm and esp files
- */
-
-alias char[4] NAME;
-alias char[32] NAME32;
-alias char[256] NAME256;
-
-union Color
-{
-  align(1) struct
-  {
-    ubyte red, green, blue, alpha;
-  }
-
-  ubyte[4] array;
-  uint value;
-
-  char[] toString() { return format("RGBA:%s", array); }
-}
-static assert(Color.sizeof==4);
-
-// State of a record struct
-enum LoadState
-  {
-    Unloaded,	// This record is not loaded, it has just been
-	        // referenced.
-    Loaded,   	// This record has been loaded by the current file
-    Previous  	// The record has been loaded by a previous file
-
-    // Finalized - might be the case for some record types, but I
-    // don't know if this actual state value would be used for
-    // anything.
-  }
-
-enum VarType { Unknown, None, Short, Int, Long, Float, String, Ignored }
-
-enum SpellSchool : int
-  {
-    Alteration = 0,
-    Conjuration = 1,
-    Destruction = 2,
-    Illusion = 3,
-    Mysticism = 4,
-    Restoration = 5,
-    Length
-  }
-
-enum Attribute : int
-  {
-    Strength = 0,
-    Intelligence = 1,
-    Willpower = 2,
-    Agility = 3,
-    Speed = 4,
-    Endurance = 5,
-    Personality = 6,
-    Luck = 7,
-    Length
-  }
-
-enum SkillEnum : int
-  {
-    Block = 0,
-    Armorer = 1,
-    MediumArmor = 2,
-    HeavyArmor = 3,
-    BluntWeapon = 4,
-    LongBlade = 5,
-    Axe = 6,
-    Spear = 7,
-    Athletics = 8,
-    Enchant = 9,
-    Destruction = 10,
-    Alteration = 11,
-    Illusion = 12,
-    Conjuration = 13,
-    Mysticism = 14,
-    Restoration = 15,
-    Alchemy = 16,
-    Unarmored = 17,
-    Security = 18,
-    Sneak = 19,
-    Acrobatics = 20,
-    LightArmor = 21,
-    ShortBlade = 22,
-    Marksman = 23,
-    Mercantile = 24,
-    Speechcraft = 25,
-    HandToHand = 26,
-    Length
-  }
-
-// Shared between SPEL (Spells), ALCH (Potions) and ENCH (Item
-// enchantments) records
-align(1) struct ENAMstruct
-{
-  // Magical effect
-  short effectID; // ID of magic effect
-
-  // Which skills/attributes are affected (for restore/drain spells etc.)
-  byte skill, attribute; // -1 if N/A
-
-  // Other spell parameters
-  int range; // 0 - self, 1 - touch, 2 - target
-  int area, duration, magnMin, magnMax;
-
-  static assert(ENAMstruct.sizeof==24);
-}
-
-// Common stuff for all the load* structs
-template LoadTT(T)
-{
-  LoadState state;
-  char[] name, id;
-
-  MonsterObject *proto;
-  static MonsterClass mc;
-
-  void makeProto(char[] clsName = null)
-    {
-      // Set up a prototype object
-      if(mc is null)
-        {
-          // Use the template type name as the Monster class name if
-          // none is specified.
-          if(clsName == "")
-            {
-              clsName = typeid(T).toString;
-
-              // Remove the module name
-              int i = clsName.rfind('.');
-              if(i != -1)
-                clsName = clsName[i+1..$];
-            }
-
-          // All the game objects are in the 'game' package
-          clsName = "game." ~ clsName;
-          mc = vm.load(clsName);
-        }
-
-      proto = mc.createObject();
-
-      proto.setString8("id", id);
-      proto.setString8("name", name);
-
-      static if(is(typeof(data.weight) == float))
-        {
-          proto.setFloat("weight", data.weight);
-          proto.setInt("value", data.value);
-        }
-
-      static if(is(typeof(data.enchant)==int))
-        proto.setInt("enchant", data.enchant);
-    }
-}
-
-template LoadT() { mixin LoadTT!(typeof(*this)); }
diff --git a/old_d_version/esm/esmmain.d b/old_d_version/esm/esmmain.d
deleted file mode 100644
index 2340ea59e9..0000000000
--- a/old_d_version/esm/esmmain.d
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (esmmain.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module esm.esmmain;
-
-public import esm.records;
-
-import ogre.ogre;
-
-/* This file is the main module for loading from ESM, ESP and ESS
-   files. It stores all the data in the appropriate data structures
-   for later referal. TODO: Put this in a class or whatever? Nah, we
-   definately only need one structure like this at any one
-   time. However, we have to deal with unloading and reloading it,
-   even though that should be the exceptional case (change of plugins,
-   etc), not the rule (loading a savegame should not alter the base
-   data set, I think, but it's to early do decide.)*/
-
-// Load a set of esm and esp files. For now, we just traverse in the
-// order given. Later, we should sort these into 'masters' and
-// 'plugins', because esms are always supposed to be loaded
-// first. TODO: I'm not sure if I should load all these in one
-// function. Do we need to be able to respond to errors in each file?
-// Nah, if anything fails, give a general error message, remove the
-// file from the list and try again. We have to be able to get a list
-// of which files depend upon which, though... this can be done before
-// this function is called.
-void loadTESFiles(char[][] files)
-{
-  // Set up all the lists to hold our data
-  initializeLists();
-
-  foreach(char[] filename; files)
-    {
-      esFile.open(filename, esmRegion);
-      while(esFile.hasMoreRecs())
-	{
-	  uint flags;
-
-	  // Read record header
-	  char[] recName = esFile.getRecName();
-	  esFile.getRecHeader(flags);
-
-	  if(flags & RecordFlags.Unknown)
-	    esFile.fail(format("UNKNOWN record flags: %xh", flags));
-
-	  loadRecord(recName);
-	}
-
-      // We have to loop through the lists and check for broken
-      // references at this point, and if all forward references were
-      // loaded. There might be other end-of-file things to do also.
-      endFiles();
-    }
-
-  esFile.close();
-
-  // Put all inventory items into one list
-  items.addList(appas, ItemType.Apparatus);
-  items.addList(lockpicks, ItemType.Pick);
-  items.addList(probes, ItemType.Probe);
-  items.addList(repairs, ItemType.Repair);
-  items.addList(lights, ItemType.Light);
-  items.addList(ingreds, ItemType.Ingredient);
-  items.addList(potions, ItemType.Potion);
-  items.addList(armors, ItemType.Armor);
-  items.addList(weapons, ItemType.Weapon);
-  items.addList(books, ItemType.Book);
-  items.addList(clothes, ItemType.Clothing);
-  items.addList(miscItems, ItemType.Misc);
-  items.addList(itemLists, ItemType.ItemList); // Leveled item lists
-
-  // Same with all actors
-  actors.addList(creatures, ItemType.Creature);
-  actors.addList(creatureLists, ItemType.CreatureList);
-  actors.addList(npcs, ItemType.NPC);
-
-  // Finally, add everything that might be looked up in a cell into
-  // one list
-  cellRefs.addList(items);
-  cellRefs.addList(actors);
-  cellRefs.addList(doors, ItemType.Door);
-  cellRefs.addList(activators, ItemType.Activator);
-  cellRefs.addList(statics, ItemType.Static);
-  cellRefs.addList(containers, ItemType.Container);
-
-  // Check that all references are resolved
-  items.endMerge();
-  actors.endMerge();
-  cellRefs.endMerge();
-
-  // Put all NPC dialogues into the hyperlink list
-  foreach(char[] id, ref Dialogue dl; dialogues.names)
-    hyperlinks.add(id, &dl);
-
-  // Finally, sort the hyperlink lists
-  hyperlinks.sort();
-}
-
-// Contains the small bits of information that we currently extract
-// from savegames.
-struct PlayerSaveInfo
-{
-  char[] cellName;
-  char[] playerName;
-  Placement pos;
-}
-
-// Load a TES savegame file (.ess). Currently VERY limited, reads the
-// player's cell name and position
-PlayerSaveInfo importSavegame(char[] file)
-{
-  PlayerSaveInfo pi;
-
-  esFile.open(file, esmRegion);
-  scope(exit) esFile.close();
-
-  if(esFile.getFileType != FileType.Ess)
-    throw new TES3FileException(file ~ " is not a savegame");
-
-  with(esFile.saveData)
-    {
-      pi.cellName = stripz(cell);
-      pi.playerName = stripz(player);
-    }
-
-  with(esFile)
-    {
-      while(hasMoreRecs())
-        {
-          if(isNextHRec("REFR"))
-            {
-              while(hasMoreSubs())
-                {
-                  getSubName();
-                  if(retSubName() == "DATA")
-                    readHExact(&pi.pos, pi.pos.sizeof);
-                  else
-                    skipHSub();
-                }
-            }
-          else
-            skipHRecord();
-        }
-    }
-  return pi;
-}
diff --git a/old_d_version/esm/filereader.d b/old_d_version/esm/filereader.d
deleted file mode 100644
index 4d1dfb2d90..0000000000
--- a/old_d_version/esm/filereader.d
+++ /dev/null
@@ -1,783 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (filereader.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module esm.filereader;
-
-private:
-import std.stdio;
-import std.stream;
-import std.string;
-
-import util.regions;
-import util.utfconvert;
-import monster.util.string;
-import core.resource;
-
-import esm.listkeeper;
-import esm.defs;
-
-public:
-
-/*
- *  Exception class for TES3File
- */
-
-class TES3FileException: Exception
-{
-  this(char[] msg) {super("Error reading TES3 file: " ~ msg);}
-  this() {this("Unknown error");}
-}
-
-// Some flags are in use that we don't know. But we don't really know
-// any of them.
-enum RecordFlags : uint
-  {
-    Flag6 = 0x20,    // Eg. adventurers_v2.0.esp (only once per file?)
-    Persistent = 0x400,
-    Flag13 = 0x1000, // Eg. Astarsis_BR.esm (several times per file?)
-    Blocked = 0x2000,
-
-    Unknown = 0xffffffff - 0x3420
-  }
-
-enum FileType
-  {
-    Unknown,
-    Esp, Plugin = Esp,
-    Esm, Master = Esm,
-    Ess, Savegame = Ess
-  }
-
-// Special files
-enum SpecialFile
-  {
-    Other,
-    Morrowind,
-    Tribunal,
-    Bloodmoon
-  }
-
-enum Version { Unknown, v12, v13 }
-
-// This struct should contain enough data to put a TES3File object
-// back into a specific file position and state. We use it to save the
-// "position" of objects in a file (eg. a cell), so we can return
-// there later and continue where we stopped (eg. when we want to load
-// that specific cell.)
-struct TES3FileContext
-{
-  char[] filename;
-  uint leftRec, leftSub;
-  ulong leftFile;
-  NAME recName, subName;
-  FileType type;
-  Version ver;
-
-  ulong filepos;
-}
-
-/**
- * Instance used to read TES3 files. Since we will only be reading one
- * file at a time, we might as well make one global instance.
- */
-TES3File esFile;
-
-/**
- * This struct reads an Elder Scrolls 3 file (esp, esm or ess)
- *
- * Makes heavy use of private variables to represent current
- * state.
- *
- * Relevant exceptions are
- * TES3FileException      - error interpreting file
- * StreamFileException    - file IO error
- */
-struct TES3File
-{
- private:
-  BufferedFile file;// Input file
-
-  // These are only used by getRecHeader and getSubHeader for
-  // asserting the file's integrity.
-  ulong leftFile;   // Number of unread bytes in file
-  uint leftRec;    // Number of unread bytes in record
-
-  // This is used by sub-record readers for integrity checking.
-  uint leftSub;    // Number of bytes in subrecord
-
-  // Name of current record and current sub-record.
-  NAME recName, subName;
-
-  char[] filename; // Filename
-  FileType type;   // File type
-  Version ver;     // File format version
-  char[] author;   // File author (max 32 bytes (with null?))
-  char[] desc;     // Description (max 256 bytes (ditto?))
-  uint records;    // Number of records in the file (doesn't seem to be right?)
-  SpecialFile spf; // Is this a file we have to treat in a special way?
-
-  struct _mast
-  {
-    char[] name;   // File name of an esm master for this file
-    ulong size;	   // The master file's size in bytes (used for
-                   // version control)
-  }
-
-  // List of esm masters for this file. For savegames this list also
-  // contains all plugins.
-  _mast masters[];
-  
-
-  // TES3.HEDR, file header struct
-  align(1) struct HEDRstruct
-  {
-    union
-    {
-      float ver;	// File format version, 1.2 and 1.3 supported.
-      uint verHex;	// 1.2 = 0x3f99999a, 1.3 = 0x3fa66666
-    }
-    int type;		// 0=esp, 1=esm, 32=ess
-    NAME32 author;	// Author's name
-    NAME256 desc;	// File description blurb
-    uint records;	// Number of records in file (?)
-  }
-
-  static assert(HEDRstruct.sizeof == 300);
-
-  // Which memory region to use for allocations.
-  RegionManager region;
-
- public:
-
-  // A struct found in the headers of savegame files. Contains quick
-  // information to get us going, like the cell name and the player
-  // name.
-  struct _saveData
-  {
-    float[6] unknown;
-    char[64] cell; // Cell name
-    float unk2; // Unknown value
-    char[32] player; // Player name
-  }
-  static assert(_saveData.sizeof == 124);
-  _saveData saveData;
-
-  // Get file information
-  char[] getFilename() { return filename; }
-  ulong getFileSize() { return file.size; }
-  ulong getPosition() { return file.position; }
-  SpecialFile getSpecial() { return spf; }
-
-  char[] retSubName() { return subName; }
-
-  bool isVer12() { return ver == Version.v12;}
-  bool isVer13() { return ver == Version.v13;}
-  FileType getFileType() { return type; }
-  _mast[] getMasters() { return masters; }
-  uint getRecords() { return records; }
-  char[] getAuthor() { return author; }
-  RegionManager getRegion() { return region; }
-
-  // Store the current file state (position, file name, version, debug
-  // info). The info should be enough to get us back on track for
-  // reading from a file, without having to reread the header or any
-  // previous records.
-  void getContext(ref TES3FileContext c)
-    {
-      c.filename = filename;
-      c.leftFile = leftFile;
-      c.leftRec = leftRec;
-      c.leftSub = leftSub;
-      c.recName[] = recName;
-      c.subName[] = subName;
-      c.type = type;
-      c.ver = ver;
-      c.filepos = file.position;
-    }
-
-  // Opens the file if it is not already opened. A region manager has
-  // to be specified.
-  void restoreContext(TES3FileContext c, RegionManager r)
-    {
-      if(filename != c.filename)
-	openFile(c.filename, r);
-      file.seekSet(cast(long)c.filepos);
-
-      // File is now open, copy state information
-      filename = c.filename;
-      leftFile = c.leftFile;
-      leftRec = c.leftRec;
-      leftSub = c.leftSub;
-      recName[] = c.recName;
-      subName[] = c.subName;
-      type = c.type;
-      ver = c.ver;
-    }
-
-  // Open a new file and assign a region
-  private void openFile(char[] filename, RegionManager r)
-  {
-    close();
-    debug writefln("Opening file");
-    if(file is null) file = new BufferedFile(new File());
-    file.open(filename);
-
-    region = r;
-  }
-
-  void open(char[] filename, RegionManager r)
-    {
-      uint flags;
-
-      debug writefln("openFile(%s, %s)", filename, r);
-      openFile(filename, r);
-
-      if(iEnds(filename, "Morrowind.esm")) spf = SpecialFile.Morrowind;
-      else if(iEnds(filename, "Tribunal.esm")) spf = SpecialFile.Tribunal;
-      else if(iEnds(filename, "Bloodmoon.esm")) spf = SpecialFile.Bloodmoon;
-      else spf = SpecialFile.Other;
-
-      debug writefln("Reading header");
-
-      // Do NOT .dup this filename, since it is referenced outside the
-      // GC's reach and might be deleted.
-      this.filename = filename;
-
-      leftFile = file.size;
-
-      // First things first
-      if(getRecName() != "TES3")
-	fail("Not a valid Morrowind file");
-
-      // Record header
-      getRecHeader(flags);
-      if(flags)
-	writefln("WARNING: Header flags are non-zero");
-
-      // Read and analyse the header data
-      HEDRstruct hedr;
-      readHNExact(&hedr, hedr.sizeof, "HEDR");
-
-      // The float hedr.ver signifies the file format version. It can
-      // take on these two values:
-      // 0x3f99999a = 1.2
-      // 0x3fa66666 = 1.3
-      if( hedr.verHex == 0x3f99999a )
-	ver = Version.v12;
-      else if( hedr.verHex == 0x3fa66666 )
-	ver = Version.v13;
-      else
-	{
-	  ver = Version.Unknown;
-	  writefln("WARNING: Unknown version: ", hedr.ver);
-	  writefln("  Hex: %X h", *(cast(uint*)&hedr.ver));
-	}
-
-      switch(hedr.type)
-	{
-	case 0: type = FileType.Esp; break;
-	case 1: type = FileType.Esm; break;
-	case 32: type = FileType.Ess; break;
-	default:
-	  type = FileType.Unknown;
-	  writefln("WARNING: Unknown file type: ", hedr.type);
-	}
-
-      author = region.copy(stripz(hedr.author));
-      desc = region.copy(stripz(hedr.desc));
-      records = hedr.records;
-
-      masters = null;
-      // Reads a MAST and a DATA fields
-      while(isNextSub("MAST"))
-	{
-	  _mast ma;
-
-	  // MAST entry - master file name
-	  ma.name = getHString();
-
-	  // DATA entry - master file size
-	  ma.size = getHNUlong("DATA");
-
-	  // Add to the master list!
-	  masters ~= ma;
-	}
-
-      if(type == FileType.Savegame)
-	{
-          // Savegame-related data
-
-          // Cell name, player name and player position
-          readHNExact(&saveData, 124, "GMDT");
-
-          // Contains eg. 0xff0000, 0xff00, 0xff, 0x0, 0x20. No idea.
-	  getSubNameIs("SCRD");
-	  skipHSubSize(20);
-
-          // Screenshot. Fits with 128x128x4 bytes
-	  getSubNameIs("SCRS");
-	  skipHSubSize(65536);
-	}
-    }
-
-  // Close the file. We do not clear any object data at this point.
-  void close()
-    {
-      debug writefln("close()");
-      if(file !is null)
-	file.close();
-      leftFile = leftRec = leftSub = 0;
-      debug writefln("Clearing strings");
-
-      recName[] = '\0';
-      subName[] = '\0';
-
-      // This tells restoreContext() that we have to reopen the file
-      filename = null;
-
-      debug writefln("exit close()");
-    }
-
-  /*
-   * Error reporting
-   */
-
-  void fail(char[] msg)
-    {
-      throw new TES3FileException
-	(msg ~ "\nFile: " ~ filename ~ "\nRecord name: " ~ recName
-	 ~ "\nSubrecord name: " ~ subName);
-    }
-
-  /************************************************************************
-   *
-   * Highest level readers, reads a name and looks it up in the given
-   * list.
-   *
-   ************************************************************************/
-
-  // This should be more than big enough for references.
-  private char lookupBuffer[200];
-
-  // Get a temporary string. This is faster and more memory efficient
-  // that the other string functions (because it is allocation free),
-  // but the returned string is only valid until tmpHString() is
-  // called again.
-  char[] tmpHString()
-  {
-    getSubHeader();
-    assert(leftSub <= lookupBuffer.length, "lookupBuffer wasn't large enough");
-
-    // Use this to test the difference in memory consumption.
-    return getString(lookupBuffer[0..leftSub]);
-  }
-
-  // These are used for file lookups
-  MeshIndex getMesh()
-  { getSubNameIs("MODL"); return resources.lookupMesh(tmpHString()); }
-  SoundIndex getSound()
-  { getSubNameIs("FNAM"); return resources.lookupSound(tmpHString()); }
-  IconIndex getIcon(char[] s = "ITEX")
-  { getSubNameIs(s); return resources.lookupIcon(tmpHString()); }
-  TextureIndex getTexture()
-  { getSubNameIs("DATA"); return resources.lookupTexture(tmpHString()); }
-
-  // The getO* functions read optional records. If they are not
-  // present, return null.
-
-  MeshIndex getOMesh()
-  { return isNextSub("MODL") ? resources.lookupMesh(tmpHString()) : MeshIndex.init; }
-  /*
-  SoundIndex getOSound()
-  { return isNextSub("FNAM") ? resources.lookupSound(tmpHString()) : SoundIndex.init; }
-  */
-  IconIndex getOIcon()
-  { return isNextSub("ITEX") ? resources.lookupIcon(tmpHString()) : IconIndex.init; }
-  TextureIndex getOTexture(char[] s="TNAM")
-  { return isNextSub(s) ? resources.lookupTexture(tmpHString()) : TextureIndex.init; }
-
-  // Reference with name s
-  template getHNPtr(Type)
-  {
-    Type* getHNPtr(char[] s, ListKeeper list)
-      { getSubNameIs(s); return cast(Type*) list.lookup(tmpHString()); }
-  }
-
-  // Reference, only get header
-  template getHPtr(Type)
-  {
-    Type* getHPtr(ListKeeper list)
-      { return cast(Type*) list.lookup(tmpHString()); }
-  }
-
-  // Optional reference with name s
-  template getHNOPtr(Type)
-  {
-    Type* getHNOPtr(char[] s, ListKeeper list)
-      { return isNextSub(s) ? cast(Type*)list.lookup(tmpHString()) : null; }
-  }
-
-  /************************************************************************
-   *
-   *  Somewhat high level reading methods. Knows about headers and
-   *  leftFile/leftRec/leftSub.
-   *
-   ************************************************************************/
-
-  // "Automatic" versions. Sets and returns recName and subName and
-  // updates leftFile/leftRec.
-  char[] getRecName()
-    {
-      if(!hasMoreRecs())
-	fail("No more records, getRecName() failed");
-      getName(recName);
-      leftFile-= 4;
-      return recName;
-    }
-
-  // This is specially optimized for LoadINFO
-  bool isEmptyOrGetName()
-    {
-      if(leftRec)
-	{
-	  file.readBlock(subName.ptr, 4);
-	  leftRec -= 4;
-	  return false;
-	}
-      return true;
-    }
-
-  // I've tried to optimize this slightly, since it gets called a LOT.
-  void getSubName()
-    {
-      if(leftRec <= 0)
-	fail("No more sub-records, getSubName() failed");
-
-      // Don't bother with error checking, we will catch an EOF upon
-      // reading the subrecord data anyway.
-      file.readBlock(subName.ptr, 4);
-
-      leftRec -= 4;
-    }
-
-  // We often expect a certain subrecord type, this makes it easy to
-  // check.
-  void getSubNameIs(char[] s)
-    {
-      getSubName();
-      if( subName != s )
-	fail("Expected subrecord "~s~" but got "~subName);
-    }
-
-  // Checks if the next sub-record is called s. If it is, run
-  // getSubName, if not, return false.
-  bool isNextSub(char[] s)
-    {
-      if(!leftRec) return false;
-
-      getName(subName);
-      if(subName != s)
-	{
-	  file.seekCur(-4);
-	  return false;
-	}
-      leftRec -= 4;
-
-      //getSubName();
-      return true;
-    }
-
-  // Same as isNextSub, only it works on records instead of
-  // sub-records. It also loads the record header.
-  bool isNextHRec(char[] s)
-    {
-      if(!leftFile) return false;
-      getName(recName);
-      if(recName != s)
-	{
-	  file.seekCur(-4);
-	  return false;
-	}
-      leftFile -= 4;
-
-      uint flags;
-      getRecHeader(flags);
-
-      return true;
-    }
-
-  bool hasMoreSubs() { return leftRec > 0; }
-  bool hasMoreRecs() { return leftFile > 0; }
-
-  // Remaining size of current record
-  uint getRecLeft() { return leftRec; }
-  // Size of current sub record
-  uint getSubSize() { return leftSub; }
-
-  // Skip the rest of this record. Assumes the name and header have
-  // already been read
-  void skipRecord()
-    {
-      file.seekCur(leftRec);
-      leftRec = 0;
-    }
-
-  // Skip an entire record
-  void skipHRecord()
-  {
-    if(!leftFile) return;
-
-    uint flags;
-
-    getRecName();
-    getRecHeader(flags);
-    skipRecord();
-  }
-
-  // Skip current sub record and return size
-  uint skipHSub()
-    {
-      getSubHeader();
-      file.seekCur(leftSub);
-      return leftSub;
-    }
-
-  // Skip sub record and check it's size
-  void skipHSubSize(uint size)
-    {
-      getSubHeader();
-      if(leftSub != size)
-	fail(format("Size mismatch: got %d, wanted %d", leftSub, size));
-      file.seekCur(leftSub);
-    }
-
-  // Check the name and size before skipping
-  void skipHNSub(char[] name, uint size)
-  {
-    getSubNameIs(name);
-    skipHSubSize(size);
-  }
-
-  // These read an entire sub-record, including the header. They also
-  // adjust and check leftSub and leftRecord variables through calling
-  // getSubHeader().
-  void readHExact(void * p, uint size)
-    {
-      getSubHeader();
-      if(leftSub != size)
-	fail(format("Size mismatch: got %d, wanted %d", leftSub, size));
-      readExact(p, leftSub);
-    }
-
-  template TgetHType(T)
-    { T TgetHType() { T t; readHExact(&t, t.sizeof); return t;} }
-
-  // To make these easier to use (and to further distinguish them from
-  // the above "raw" versions), these return their value instead of
-  // using an ref argument.
-  alias TgetHType!(uint) getHUint;
-  alias TgetHType!(int) getHInt;
-  alias TgetHType!(float) getHFloat;
-  alias TgetHType!(ulong) getHUlong;
-  alias TgetHType!(byte) getHByte;
-
-  // Reads a string sub-record, including header
-  char[] getHString()
-    {
-      getSubHeader();
-
-      // Hack to make MultiMark.esp load. Zero-length strings do not
-      // occur in any of the official mods, but MultiMark makes use of
-      // them. For some reason, they break the rules, and contain a
-      // byte (value 0) even if the header says there is no data. If
-      // Morrowind accepts it, so should we.
-      if(leftSub == 0)
-	{
-	  // Skip the following zero byte
-	  leftRec--;
-	  assert(file.getc() == 0);
-	  // TODO: Report this by setting a flag or something?
-	  return null;
-	}
-
-      return getString(region.getString(leftSub));
-    }
-
-  // Other quick aliases (this is starting to get messy)
-  // Get string sub record string with name s
-  char[] getHNString(char[] s)
-    { getSubNameIs(s); return getHString(); }
-
-  // Get optional sub record string with name s
-  char[] getHNOString(char[] s)
-    { return isNextSub(s) ? getHString() : null; }
-
-  template TgetHNType(T)
-    { T TgetHNType(char[] s) { T t; readHNExact(&t, t.sizeof, s); return t;} }
-
-  template TgetHNOType(T)
-    {
-      T TgetHNOType(char[] s, T def)
-	{
-	  if(isNextSub(s))
-	    {
-	      T t;
-	      readHExact(&t, t.sizeof);
-	      return t;
-	    }
-	  else return def;
-	}
-    }
-
-  alias TgetHNType!(uint) getHNUint;
-  alias TgetHNType!(int) getHNInt;
-  alias TgetHNType!(float) getHNFloat;
-  alias TgetHNType!(ulong) getHNUlong;
-  alias TgetHNType!(byte) getHNByte;
-  alias TgetHNType!(short) getHNShort;
-  alias TgetHNType!(byte) getHNByte;
-
-  alias TgetHNOType!(float) getHNOFloat;
-  alias TgetHNOType!(int) getHNOInt;
-  alias TgetHNOType!(byte) getHNOByte;
-
-  void readHNExact(void* p, uint size, char[] s)
-    { getSubNameIs(s); readHExact(p,size); }
-
-  // Record header
-  // This updates the leftFile variable BEYOND the data that follows
-  // the header, ie beyond the entire record. You are supposed to use
-  // the leftRec variable when reading record data.
-  void getRecHeader(out uint flags)
-    {
-      // General error checking
-      if(leftFile < 12)
-	fail("End of file while reading record header");
-      if(leftRec)
-	fail(format("Previous record contains %d unread bytes", leftRec));
-
-      getUint(leftRec);
-      getUint(flags);// This header entry is always zero
-      assert(flags == 0);
-      getUint(flags);
-      leftFile -= 12;
-
-      // Check that sizes add up
-      if(leftFile < leftRec)
-	fail(format(leftFile, " bytes left in file, but next record contains ",
-		    leftRec," bytes"));
-
-      // Adjust number of bytes left in file
-      leftFile -= leftRec;
-    }
-
-  // Sub-record head
-  // This updates leftRec beyond the current sub-record as
-  // well. leftSub contains size of current sub-record.
-  void getSubHeader()
-    {
-      if(leftRec < 4)
-	fail("End of record while reading sub-record header");
-
-      if(file.readBlock(&leftSub, 4) != 4)
-	fail("getSubHeader could not read header length");
-
-      leftRec -= 4;
-
-      // Adjust number of record bytes left
-      leftRec -= leftSub;
-
-      // Check that sizes add up
-      if(leftRec < 0)
-	fail(format(leftRec+leftSub,
-	     " bytes left in record, but next sub-record contains ",
-	      leftSub," bytes"));
-    }
-
-  void getSubHeaderIs(uint size)
-    {
-      getSubHeader();
-      if(leftSub != size)
-	fail(format("Expected header size to be ", size, ", not ", leftSub));
-    }
-
-  /*************************************************************************
-   *
-   *  Low level reading methods
-   *
-   *************************************************************************/
-
-  /// Raw data of any size
-  void readExact(void *buf, uint size)
-    {
-      assert(size != 0);
-      file.readExact(buf,size);
-    }
-
-  // One byte
-  void getByte(out byte b) { file.read(b); }
-  void getUByte(out ubyte b) { file.read(b); }
-  // Two bytes
-  void getUShort(out ushort s) { file.read(s); }
-  // Four bytes
-  void getUint(out uint u) { file.read(u); }
-  void getInt(out int i) { file.read(i); }
-  void getFloat(out float f) { file.read(f); }
-  // Eight bytes
-  void getUlong(out ulong l) { file.read(l); }
-
-  // Get a record or subrecord name, four bytes
-  void getName(NAME name)
-    {
-      file.readBlock(name.ptr, 4);
-      /*
-      if(file.readBlock(name.ptr, 4) != 4)
-	fail("getName() could not find more data");
-      */
-    }
-
-  // Fill buffer of predefined length. If actual string is shorter
-  // (ie. null terminated), the buffer length is set
-  // accordingly. Chopped string is returned. All strings pass through
-  // this function, so any character encoding conversions should
-  // happen here.
-  char[] getString(char[] str)
-    {
-      if(str.length != file.readBlock(str.ptr,str.length))
-	fail("getString() could not find enough data in stream");
-
-      str = stripz(str);
-      makeUTF8(str); // TODO: A hack. Will replace non-utf characters
-                     // with question marks. This is neither a very
-                     // desirable result nor a very optimized
-                     // implementation of it.
-      return str;
-    }
-
-  // Use this to allocate and read strings of predefined length
-  char[] getString(int l)
-  {
-    char[] str = region.getString(l);
-    return getString(str);
-  }
-}
diff --git a/old_d_version/esm/imports.d b/old_d_version/esm/imports.d
deleted file mode 100644
index 69f1d33dce..0000000000
--- a/old_d_version/esm/imports.d
+++ /dev/null
@@ -1,47 +0,0 @@
-module esm.imports;
-
-/* This is a file that imports common modules used by the load*.d
-   record loaders. It is really a cut down version of what used to be
-   the start of records.d.
-
-   This file MUST NOT import records.d - directly or indirectly -
-   because that will trigger a nice three page long list of template
-   forwarding errors from the compiler.
-
-   What happens is that when DMD/GDC compiles one of the load* files,
-   it is forced to read records.d first (since it is an imported
-   module) - but then it sees a template that referes to a struct in
-   the current load* file, before that struct is defined. Curriously
-   enough, DMD has no problems when you specify all the source files
-   on the command line simultaneously. This trick doesn't work with
-   GDC though, and DSSS doesn't use it either.
-
-   This file was created to work around this compiler bug.
-*/
-
-public
-{
-import esm.defs;
-import esm.filereader;
-import esm.listkeeper;
-
-import core.resource;
-import core.memory;
-
-import util.regions;
-import monster.util.aa;
-
-import std.stdio;
-import std.string;
-
-alias RegionBuffer!(ENAMstruct) EffectList;
-
-// Records that are cross referenced often
-import esm.loadscpt;
-import esm.loadsoun;
-import esm.loadspel;
-import esm.loadench;
-
-import monster.monster;
-}
-
diff --git a/old_d_version/esm/listkeeper.d b/old_d_version/esm/listkeeper.d
deleted file mode 100644
index 3722a5d12e..0000000000
--- a/old_d_version/esm/listkeeper.d
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (listkeeper.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module esm.listkeeper;
-
-import monster.util.aa;
-
-import core.memory;
-
-import esm.filereader;
-import esm.defs;
-
-import std.stdio;
-
-// Item types, used in the lookup table for inventory items, creature
-// lists and leveled lists. We also use it for all types of references
-// that can exist in cells.
-enum ItemType
-  {
-    // Items
-    None = 0, Potion, Apparatus, Armor, Weapon, Book, Clothing,
-    Light, Ingredient, Pick, Probe, Repair, Misc, ItemList,
-
-    // Used for creature lists
-    Creature, CreatureList, NPC,
-
-    // Other cell references
-    Door, Activator, Static, Container//, SoundGen
-  }
-
-abstract class ListKeeper
-{
-  int listIndex;
-
-  new(uint size)
-    { 
-      return esmRegion.allocate(size).ptr;
-    }
-
-  delete(void *p) { assert(0); }
-
-  this()
-    {
-      // Store our index for later use
-      listIndex = recordLists.length;
-
-      // Add the class to the global list
-      recordLists ~= this;
-    }
-
-  // Load a record from a master or plugin file
-  void load();
-
-  // Looks up a reference. If it does not exist it is assumed to be a
-  // forward reference within a file, and is inserted.
-  void* lookup(char[] s);
-
-  // Tell the loader that current file has ended, so it can do things
-  // like check that all referenced objects have been loaded.
-  void endFile();
-
-  // Number of inserted elements
-  uint length();
-
-  void addToList(ref ItemBaseList l, ItemType t) { assert(0); }
-}
-
-ListKeeper recordLists[];
-
-// Keep the list of Type structures for records where the first
-// subrecord is an id string called NAME. This id is used for
-// lookup. Although almost all lookups match in case, there are a few
-// sounds that don't, so we treat these id lookups as generally case
-// insensitive. This hasn't posed any problems so far.
-class ListID(Type) : ListKeeper
-{
-  HashTable!(char[], Type, ESMRegionAlloc, CITextHash) names;
-
-  this(uint size)
-    {
-      names = names.init;
-      if(size) names.rehash(size);
-    }
-
-  // Reads the id for this header. Override if the id is not simply
-  // getHNString("NAME")
-  char[] getID()
-    {
-      return esFile.getHNString("NAME");
-    }
-
-  // Load a record from a master of plugin file
-  void load()
-    {
-      assert(esFile.getFileType == FileType.Esm ||
-	     esFile.getFileType == FileType.Esp);
-
-      // Get the identifier of this record
-      char[] id = getID();
-
-      // Get pointer to a new or existing object.
-      Type *p;
-      if(names.insertEdit(id, p))
-	// A new item was inserted
-	{
-	  p.state = LoadState.Unloaded;
-	  p.id = id;
-	  p.load();
-	  p.state = LoadState.Loaded;
-	}
-      else
-	// Item already existed, either from a previous file or as a
-	// forward reference from this file. Load on top of it. The
-	// LoadState tells the struct whether it contains loaded data.
-	{
-          /*
-	  if(p.state == LoadState.Loaded)
-	    // Make a special case for this, perhaps, or just ignore it.
-	    writefln("WARNING: Duplicate record in file %s: '%s'",
-		     esFile.getFilename(), id);
-          */
-
-	  assert(icmp(p.id, id) == 0);
-	  p.load();
-	  p.state = LoadState.Loaded;
-	}
-    }
-
-  // Looks up a reference. If it does not exist it is assumed to be a
-  // forward reference within a file, and is inserted.
-  void* lookup(char[] id)
-    {
-      if(!id.length) return null; // Empty reference
-
-      Type *p = names.lookup(id);
-      // Is the value in the list?
-      if(!p)
-	// No, assume it is a forward reference.
-	{
-	  // Since the lookup name is stored in an internal buffer in
-	  // esFile, we have to copy it.
-	  id = esmRegion.copy(id);
-
-	  // To avoid copying the string on every lookup, we have to
-	  // insert in a separate step. But a double lookup isn't
-	  // really THAT expensive. Besides, my tests show that this
-	  // is used in less than 10% of the cases.
-	  names.insertEdit(id, p);
-	  p.id = id;
-	  p.state = LoadState.Unloaded;
-	}
-      return cast(void*)p;
-    }
-
-  // Check that all referenced objects are actually loaded.
-  void endFile()
-  in
-  {
-    // We can skip this in release builds
-    names.validate();
-  }
-  body
-  {
-    foreach(char[] id, ref Type t; names)
-      // Current file is now counted as done
-      if(t.state == LoadState.Loaded) t.state = LoadState.Previous;
-      else if(t.state == LoadState.Unloaded)
-	//writefln("WARNING: Unloaded reference " ~ id);
-	esFile.fail("Unloaded reference " ~ id);
-  }
-
-  // Number of inserted elements
-  uint length() {return names.length;}
-
-  // Add the names in this list to an ItemList
-  void addToList(ref ItemBaseList l, ItemType t)
-    {
-      foreach(char[] id, ref Type s; names)
-	l.insert(id, &s, t);
-    }
-}
-
-// A pointer to an item
-struct ItemBase
-{
-  ItemType type;
-  void *p;
-}
-
-struct ItemBaseList
-{
-  HashTable!(char[],ItemBase,ESMRegionAlloc) list;
-
-  void addList(ItemBaseList l)
-  {
-    foreach(char[] id, ItemBase b; l.list)
-      insert(id, b.p, b.type);
-  }
-
-  void addList(ListKeeper source, ItemType type)
-  {
-    source.addToList(*this, type);
-  }
-
-  void insert(char[] id, void* p, ItemType type)
-  {
-    ItemBase *b;
-    if(!list.insertEdit(id, b))
-      {
-	//writefln("Replacing item ", id);
-	if(b.type != ItemType.None)
-	  esFile.fail("Replaced valid item: " ~ id);
-      }
-    //else writefln("Inserting new item ", id);
-
-    b.type = type;
-    b.p = p;
-  }
-
-  // Called at the end to check that all referenced items have been resolved
-  void endMerge()
-  {
-    foreach(char[] id, ref ItemBase t; list)
-      // Current file is now counted as done
-      if(t.type == ItemType.None)
-	// TODO: Don't use esFile.fail for this
-	esFile.fail("ItemBaseList: Unresolved forward reference: " ~ id);
-  }
-
-  // Look up an item, return a pointer to the ItemBase representing
-  // it. If it does not exist, it is inserted.
-  ItemBase *lookup(char[] id)
-  {
-    if(!id.length) return null; // Empty reference
-    ItemBase *b = list.lookup(id);
-    // Is the value in the list?
-    if(!b)
-      // No, assume it is a forward reference.
-      {
-	// Since the lookup name is stored in an internal buffer in
-	// esFile, we have to copy it.
-	id = esmRegion.copy(id);
-
-	// To avoid copying the string on every lookup, we have to
-	// insert in a separate step. But a double lookup isn't
-	// really THAT expensive.
-	list.insertEdit(id, b);
-
-	b.p = null;
-	b.type = ItemType.None;
-      }
-    return b;
-  }
-}
-
-// An item. Contains a reference to an ItemBase, which again is a
-// reference to an item. The ItemBase might change after we have
-// looked it up (for forward references), so we have to use a pointer.
-struct Item
-{
-  ItemBase *i;
-
-  void* getPtr(ItemType type)
-  {
-    if(i != null && i.type == type) return i.p;
-    return null;
-  }
-
-  T* getType(T, ItemType Type)()
-  {
-    return cast(T*)getPtr(Type);
-  }
-}
-
-struct ItemList
-{
-  private:
-  ItemBaseList list;
-
-  public:
-  void addList(ItemList l)
-    { list.addList(l.list); }
-
-  void addList(ListKeeper source, ItemType type)
-    { list.addList(source, type); }
-
-  Item lookup(char[] id)
-  {
-    Item i;
-    i.i = list.lookup(id);
-    return i;
-  }
-
-  void endMerge()
-    { list.endMerge(); }
-
-  void endFile()
-  in { list.list.validate(); }
-  body {}
-
-  void rehash(uint size)
-    { list.list.rehash(size); }
-
-  uint length() { return list.list.length(); }
-}
-
-// Aggregate lists, made by concatinating several other lists.
-ItemList items;		// All inventory items, including leveled item lists
-ItemList actors;	// All actors, ie. NPCs, creatures and leveled lists
-ItemList cellRefs;	// All things that are referenced from cells
diff --git a/old_d_version/esm/loadcell.d b/old_d_version/esm/loadcell.d
deleted file mode 100644
index 6f987e2e05..0000000000
--- a/old_d_version/esm/loadcell.d
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
-   This file contains some leftovers which have not yet been ported to
-   C++.
- */
-
-align(1) struct AMBIStruct
-{
-  Color ambient, sunlight, fog;
-  float fogDensity;
-
-  static assert(AMBIStruct.sizeof == 16);
-}
-
-int max(int x, int y)
-{ return x>=y?x:y; }
-
-struct ExtCellHash
-{
-  // This is a pretty good hash, gives no collisions for all of
-  // Morrowind.esm when the table size is 2048, and it gives very few
-  // collisions overall. Not that it matters that much.
-  static uint hash(uint val)
-  {
-    uint res = cast(ushort)val;
-    res += *(cast(ushort*)&val+1)*41;
-    return res;
-  }
-
-  static bool isEqual(uint a, uint b) { return a==b; }
-}
-
-class CellList : ListKeeper
-{
-  // Again, these are here to avoid DMD template bugs
-  alias _aaNode!(char[], InteriorCell) _unused1;
-  alias _aaNode!(uint, ExteriorCell) _unused2;
-
-  HashTable!(char[], InteriorCell, ESMRegionAlloc) in_cells;
-  HashTable!(uint, ExteriorCell, ESMRegionAlloc, ExtCellHash) ex_cells;
-
-  // Store the maximum x or y coordinate (in absolute value). This is
-  // used in the landscape pregen process.
-  int maxXY;
-
-  this()
-    {
-      in_cells = in_cells.init;
-      in_cells.rehash(1600);
-
-      ex_cells = ex_cells.init;
-      ex_cells.rehash(1800);
-    }
-
-  align(1) struct DATAstruct
-  {
-    CellFlags flags;
-    int gridX, gridY;
-    static assert(DATAstruct.sizeof==12);
-  }
-
-  DATAstruct data;
-
-  // Look up an interior cell, throws an error if not found (might
-  // change later)
-  InteriorCell *getInt(char[] s)
-    {
-      return in_cells.getPtr(s);
-    }
-
-  // Exterior cell, same as above
-  ExteriorCell *getExt(int x, int y)
-    {
-      return ex_cells.getPtr(compound(x,y));
-    }
-
-  // Check whether we have a given exterior cell
-  bool hasExt(int x, int y)
-    {
-      return ex_cells.inList(compound(x,y));
-    }
-
-  void *lookup(char[] s)
-    { assert(0); }
-
-  void endFile()
-    out
-    {
-      in_cells.validate();
-      ex_cells.validate();
-    }
-    body
-    {
-      foreach(id, ref c; in_cells)
-	{
-	  if(c.state == LoadState.Loaded) c.state = LoadState.Previous;
-	  // We never forward reference cells!
-	  assert(c.state != LoadState.Unloaded);
-	}
-
-      foreach(id, ref c; ex_cells)
-	{
-	  if(c.state == LoadState.Loaded) c.state = LoadState.Previous;
-	  // We never forward reference cells!
-	  assert(c.state != LoadState.Unloaded);
-	}
-    }
-
-  uint length() { return numInt() + numExt(); }
-  uint numInt() { return in_cells.length; }
-  uint numExt() { return ex_cells.length; }
-
-  // Turn an exterior cell grid position into a unique number
-  static uint compound(int gridX, int gridY)
-    {
-      return cast(ushort)gridX + ((cast(ushort)gridY)<<16);
-    }
-
-  static void decompound(uint val, out int gridX, out int gridY)
-    {
-      gridX = cast(short)(val&0xffff);
-      gridY = cast(int)(val&0xffff0000) >> 16;
-    }
-
-  void load()
-    {with(esFile){
-      char[] id = getHNString("NAME");
-
-      // Just ignore this, don't know what it does. I assume it
-      // deletes the cell, but we can't handle that yet.
-      if(isNextSub("DELE")) getHInt();
-
-      readHNExact(&data, data.sizeof, "DATA");
-
-      if(data.flags & CellFlags.Interior)
-	{
-	  InteriorCell *p;
-	  if(in_cells.insertEdit(id, p))
-	    // New item was inserted
-	    {
-	      p.state = LoadState.Unloaded;
-	      p.id = id;
-	      p.flags = data.flags;
-	      p.load();
-	      p.state = LoadState.Loaded;
-	    }
-	  else
-	    // Overloading an existing cell
-	    {
-	      if(p.state != LoadState.Previous)
-		fail("Duplicate interior cell " ~ id);
-
-	      assert(id == p.id);
-	      p.load();
-	      p.state = LoadState.Loaded;
-	    }
-	}
-      else // Exterior cell
-	{
-	  uint key = compound(data.gridX, data.gridY);
-
-	  ExteriorCell *p;
-	  if(ex_cells.insertEdit(key, p))
-	    // New cell
-	    {
-	      p.state = LoadState.Unloaded;
-	      p.name = id;
-	      p.flags = data.flags;
-	      p.gridX = data.gridX;
-	      p.gridY = data.gridY;
-	      p.load();
-	      p.state = LoadState.Loaded;
-
-              int mx = max(abs(p.gridX), abs(p.gridY));
-              maxXY = max(maxXY, mx);
-	    }
-	  else
-	    {
-	      if(p.state != LoadState.Previous)
-		fail(format("Duplicate exterior cell %d %d",
-			    data.gridX, data.gridY));
-	      assert(p.gridX == data.gridX);
-	      assert(p.gridY == data.gridY);
-	      p.load();
-	      p.state = LoadState.Loaded;
-	    }
-	}
-    }}
-}
-CellList cells;
diff --git a/old_d_version/esm/loaddial.d b/old_d_version/esm/loaddial.d
deleted file mode 100644
index 6e36f0b887..0000000000
--- a/old_d_version/esm/loaddial.d
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (loaddial.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module esm.loaddial;
-import esm.imports;
-import esm.loadinfo;
-
-/*
- * Dialogue topic and journal entries. The acutal data is contained in
- * the following INFO records.
- */
-
-// Keep a list of possible hyper links. This list is used when parsing
-// text and finding references to topic names. Eg. if a character says
-// "Would you like to join the mages guild?", we must be able to pick
-// out the phrase "join the mages guild?" and make a hyperlink of
-// it. Each link is indexed by their first word. The structure
-// contains the rest of the phrase, so the phrase above would be
-// indexed by "join" and contain the string "the mages guild?", for
-// quick comparison with the text are currently parsing. It also
-// contains a pointer to the corresponding dialogue struct. The lists
-// are sorted by descending string length, in order to match the
-// longest possible term first.
-
-struct Hyperlink
-{
-  Dialogue *ptr;
-  char[] rest;
-
-  // Returns a < b if a.length > b.length.
-  int opCmp(Hyperlink *h) {return h.rest.length - rest.length;}
-}
-
-alias RegionBuffer!(Hyperlink) HyperlinkArray;
-
-// This is much nicer now that we use our own AA.
-struct HyperlinkList
-{
-  // Make a case insensitive hash table of Hyperlink arrays.
-  HashTable!(char[], HyperlinkArray, ESMRegionAlloc, CITextHash) list;
-
-  void add(char[] topic, Dialogue* ptr)
-  {
-    // Only add dialogues
-    if(ptr.type != Dialogue.Type.Topic) return;
-
-    Hyperlink l;
-    l.ptr = ptr;
-    l.rest = topic;
-
-    // Use the first word as the index
-    topic = nextWord(l.rest);
-
-    // Insert a new array, or get an already existing one
-    HyperlinkArray ha = list.get(topic,
-	// Create a new array
-	delegate void (ref HyperlinkArray a)
-	{ a = esmRegion.getBuffer!(Hyperlink)(0,1); }
-	);
-
-    // Finally, add it to the list
-    ha ~= l;
-  }
-
-  Hyperlink[] getList(char[] word)
-  {
-    HyperlinkArray p;
-    if(list.inList(word, p)) return p.array();
-    return null;
-  }
-
-  void rehash(uint size)
-  {
-    list.rehash(size);
-  }
-
-  // We wouldn't need this if we only dealt with one file, since the
-  // topics are already sorted in Morrowind.esm. However, other files
-  // might add items out of order later, so we have to sort it. To
-  // understand why this is needed, consider the following example:
-  //
-  // Morrowind.esm contains the topic 'join us'. When ever the text
-  // ".. join us blahblah ..." is encountered, this match is
-  // found. However, if a plugin adds the topic 'join us today', we
-  // have to place this _before_ 'join us' in the list, or else it
-  // will never be matched.
-  void sort()
-  {
-    foreach(char[] s, HyperlinkArray l; list)
-      {
-	l.array().sort;
-	/*
-	writefln("%s: ", s, l.length);
-	foreach(Hyperlink h; l.array())
-	  writefln("  %s (%s)", h.rest, h.ptr.id);
-	*/
-      }
-  }
-}
-
-// List of dialogue hyperlinks
-HyperlinkList hyperlinks;
-
-struct Dialogue
-{
-  enum Type
-    {
-      Topic		= 0,
-      Voice		= 1,
-      Greeting		= 2,
-      Persuasion	= 3,
-      Journal		= 4,
-      Deleted		= -1
-    }
-
-  //Type type;
-  DialogueType type;
-
-  DialInfoList infoList;
-
-  char[] id; // This is the 'dialogue topic' that the user actually
-	     // sees.
-  LoadState state;
-
-  void load()
-  {with(esFile){
-    getSubNameIs("DATA");
-
-    getSubHeader();
-    int si = getSubSize();
-    if(si == 1)
-      {
-	byte b;
-	getByte(b);
-	DialogueType t = cast(DialogueType)b;
-
-	// Meet the new type, same as the old type
-	if(t != this.type && state == LoadState.Previous)
-	  fail("Type changed in dialogue " ~ id);
-
-	this.type = t;
-      }
-    else if(si == 4)
-      {
-	// These are just markers, their values are not used.
-	int i;
-	getInt(i);
-	//writefln("In file %s:", getFilename());
-	//writefln("  WARNING: DIAL.DATA was size 4 and contains: ", i);
-	i = getHNInt("DELE");
-	//writefln("  DELE contains ", i);
-	this.type = Type.Deleted;
-      }
-    else fail("Unknown sub record size " ~ toString(si));
-
-    infoList.state = state;
-    while(isNextHRec("INFO"))
-      infoList.load(this.type);
-    //skipRecord();
-  }}
-}
-
-typedef Dialogue.Type DialogueType;
-
-/+
-    // I don't remember when I commented out this code or what state
-    // it is in. Probably highly experimental.
-    // --------------
-
-    // Loop through the info blocks in this dialogue, and update the
-    // master as necessary.
-
-    // TODO: Note that the dialogue system in Morrowind isn't very
-    // robust. If several mods insert dialogues at exactly the same
-    // place, the mods loaded last might overwrite the previous mods,
-    // completely removing the previous entry even if the two entries
-    // do not have the same id. This is because a change also
-    // overwrites the previous and the next entry, in order to update
-    // their "previous" and "next" fields. Furthermore, we might put
-    // ourselves in a situation where the forward and backward chains
-    // do not match, or in a situation where we update a deleted
-    // info. For now I do nothing about it, but I will have to develop
-    // a "conflict manager" later on. It SHOULD be possible to merge
-    // these info lists automatically in most cases, but it
-    // complicates the code.
-
-    // Whoa, seems we have a case study already with just tribunal and
-    // bloodmoon loaded! See comments below.
-
-    foreach(char[] id, ref DialInfoLoad m; mod.infoList)
-      {
-	// Remove the response if it is marked as deleted.
-	if(m.deleted)
-	  {
-	    if((id in master.infoList) == null)
-	      writefln("Cannot delete info %s, does not exist", id);
-	    else master.infoList.remove(id);
-	  }
-	else
-	  // Just plain copy it in.
-	  master.infoList[id] = m;
-      }
-  }
-
-  // Here we have to fix inconsistencies. A good case example is the
-  // dialogue "Apelles Matius" in trib/blood. Trib creates a
-  // dialogue of a few items, bloodmoon adds another. But since the
-  // two are independent, the list in bloodmoon does not change the
-  // one in trib but rather creates a new one. In other words, we
-  // will have to deal with the possibility of several "independent"
-  // lists within each topic. We can do this by looking for several
-  // start points (ie. infos with prev="") and just latch them onto
-  // each other. I'm not sure it gives the correct result,
-  // though. For example, which list comes first would be rather
-  // arbitrarily decided by the order we traverse the infoList AA. I
-  // will just have to assume that they truly are "independent".
-
-  // There still seems to be a problem though. Bloodmoon overwrites
-  // some stuff added by Tribunal, see "Boots of the Apostle" for an
-  // example. Looks like the editor handles it just fine... We need
-  // to make sure that all the items in our AA are put into the
-  // list, and in the right place too. We obviously cannot fully
-  // trust the 'next' and 'prev' fields, but they are the only
-  // guidance we have. Deal with it later!
-
-  // At this point we assume "master" to contain the final dialogue
-  // list, so at this point we can set it in stone.
-  infoList.length = master.infoList.length;
-
-  // Find the first entry
-  DialInfoLoad* starts[]; // starting points for linked lists
-  DialInfoLoad *current;
-  foreach(char[] id, ref DialInfoLoad l; master.infoList)
-    if(l.prev == "") starts ~= &l;
-
-  foreach(int num, ref DialInfo m; infoList)
-    {
-      if(current == null)
-	{
-	  if(starts.length == 0)
-	    {
-	      writefln("Error: No starting points!");
-	      infoList.length = num;
-	      break;
-	    }
-	  // Pick the next starting point
-	  current = starts[0];
-	  starts = starts[1..$];
-	}
-      m.copy(*current, this);
-
-      if((*current).next == "")
-	current = null;
-      else
-	{
-	  current = (*current).next in master.infoList;
-	  if(current == null)
-	    {
-	      writefln("Error in dialouge info lookup!");
-	      break;
-	    }
-	}
-    }
-  if(infoList.length != master.infoList.length)
-    writefln("Dialogue list lengths do not match, %d != %d",
-	     infoList.length, master.infoList.length);
-  }
-}
-+/
diff --git a/old_d_version/esm/records.d b/old_d_version/esm/records.d
deleted file mode 100644
index d5dd211a19..0000000000
--- a/old_d_version/esm/records.d
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (records.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-module esm.records;
-
-public
-{
-  import monster.util.aa;
-  import util.regions;
-  
-  import core.memory;
-  import core.resource;
-
-  import esm.filereader;
-  import esm.defs;
-  import esm.listkeeper;
-
-  import std.stdio; // Remove later
-}
-
-public import
-  esm.loadacti, esm.loaddoor, esm.loadglob, esm.loadscpt, esm.loadsoun, esm.loadgmst,
-  esm.loadfact, esm.loadstat, esm.loadspel, esm.loadalch, esm.loadappa, esm.loadarmo,
-  esm.loadbody, esm.loadench, esm.loadbook, esm.loadbsgn, esm.loadltex, esm.loadmgef,
-  esm.loadweap, esm.loadlocks,esm.loadcell, esm.loadregn, esm.loadligh, esm.loadskil,
-  esm.loadsndg, esm.loadrace, esm.loadmisc, esm.loadclot, esm.loadingr, esm.loadclas,
-  esm.loadcont, esm.loadcrea, esm.loadnpc,  esm.loaddial, esm.loadinfo, esm.loadsscr,
-  esm.loadlevlist;
-
-void loadRecord(char[] recName)
-{
-  switch(recName)
-    {
-    case "ACTI": activators.load(); break;
-    case "DOOR": doors.load(); break;
-    case "GLOB": globals.load(); break;
-    case "SCPT": scripts.load(); break;
-    case "SOUN": sounds.load(); break;
-    case "GMST": gameSettings.load(); break;
-    case "FACT": factions.load(); break;
-    case "STAT": statics.load(); break; 
-    case "SPEL": spells.load(); break;
-    case "ALCH": potions.load(); break;
-    case "APPA": appas.load(); break;
-    case "ARMO": armors.load(); break;
-    case "BODY": bodyParts.load(); break;
-    case "ENCH": enchants.load(); break;
-    case "BOOK": books.load(); break;
-    case "BSGN": birthSigns.load(); break;
-    case "LTEX": landTextures.load(); break;
-    case "MGEF": effects.load(); break;
-    case "WEAP": weapons.load(); break;
-    case "REPA": repairs.load(); break;
-    case "LOCK": lockpicks.load(); break;
-    case "PROB": probes.load(); break;
-    case "CELL": cells.load(); break;
-    case "REGN": regions.load(); break;
-    case "LIGH": lights.load(); break;
-    case "SKIL": skills.load(); break;
-    case "SNDG": soundGens.load(); break;
-    case "RACE": races.load(); break;
-    case "MISC": miscItems.load(); break;
-    case "CLOT": clothes.load(); break;
-    case "INGR": ingreds.load(); break;
-    case "CLAS": classes.load(); break;
-    case "CONT": containers.load(); break;
-    case "CREA": creatures.load(); break;
-    case "LEVI": itemLists.load(); break;
-    case "LEVC": creatureLists.load(); break;
-    case "NPC_": npcs.load(); break;
-    case "DIAL": dialogues.load(); break;
-    case "SSCR": startScripts.load(); break;
-  /*
-
-      // Tribunal / Bloodmoon only
-    case "SSCR": loadSSCR.load(); break;
-
-  */
-      // For save games:
-      // case "NPCC": loadNPCC;
-      // case "CNTC": loadCNTC;
-      // case "CREC": loadCREC;
-
-      // These should never be looked up
-    case "TES3":
-    case "INFO":
-    case "LAND":
-    case "PGRD":
-      esFile.fail("Misplaced record " ~ recName);
-    default:
-      esFile.fail("Unknown record type " ~ recName);
-    }
-  //*/
-}
-
-// Um, this has to be in this file for some reason.
-ListID!(Dialogue) dialogues;
-
-struct ItemT
-{
-  Item item;
-  ItemBase *i;
-
-  T* getType(T, ItemType Type)()
-  {
-    return item.getType!(T, Type)();
-  }
-
-  alias getType!(Potion, ItemType.Potion) getPotion;
-  alias getType!(Apparatus, ItemType.Apparatus) getApparatus;
-  alias getType!(Armor, ItemType.Armor) getArmor;
-  alias getType!(Weapon, ItemType.Weapon) getWeapon;
-  alias getType!(Book, ItemType.Book) getBook;
-  alias getType!(Clothing, ItemType.Clothing) getClothing;
-  alias getType!(Light, ItemType.Light) getLight;
-  alias getType!(Ingredient, ItemType.Ingredient) getIngredient;
-  alias getType!(Tool, ItemType.Pick) getPick;
-  alias getType!(Tool, ItemType.Probe) getProbe;
-  alias getType!(Tool, ItemType.Repair) getRepair;
-  alias getType!(Misc, ItemType.Misc) getMisc;
-  alias getType!(LeveledItems, ItemType.ItemList) getItemList;
-  alias getType!(Creature, ItemType.Creature) getCreature;
-  alias getType!(LeveledCreatures, ItemType.CreatureList) getCreatureList;
-  alias getType!(NPC, ItemType.NPC) getNPC;
-  alias getType!(Door, ItemType.Door) getDoor;
-  alias getType!(Activator, ItemType.Activator) getActivator;
-  alias getType!(Static, ItemType.Static) getStatic;
-  alias getType!(Container, ItemType.Container) getContainer;
-
-  static ItemT opCall(Item it)
-  {
-    ItemT itm;
-    itm.item = it;
-    itm.i = it.i;
-    return itm;
-  }
-}
-
-void endFiles()
-{
-  foreach(ListKeeper l; recordLists)
-    l.endFile();
-
-  items.endFile();
-}
-
-void initializeLists()
-{
-  recordLists = null;
-
-  // Initialize all the lists here. The sizes have been chosen big
-  // enough to hold the main ESM files and a large number of mods
-  // without rehashing.
-
-  activators = new ListID!(Activator)(1400);
-  doors = new ListID!(Door)(300);
-  globals = new ListID!(Global)(300);
-  scripts = new ScriptList(1800);
-  sounds = new ListID!(Sound)(1000);
-  gameSettings = new ListID!(GameSetting)(1600);
-  factions = new ListID!(Faction)(30);
-  statics = new ListID!(Static)(4000);
-  spells = new ListID!(Spell)(1300);
-  potions = new ListID!(Potion)(300);
-  appas = new ListID!(Apparatus)(30);
-  armors = new ListID!(Armor)(500);
-  bodyParts = new ListID!(BodyPart)(2300);
-  enchants = new ListID!(Enchantment)(1000);
-  books = new ListID!(Book)(700);
-  birthSigns = new ListID!(BirthSign)(30);
-  landTextures = new LandTextureList;
-  effects = new MagicEffectList;
-  weapons = new ListID!(Weapon)(700);
-  lockpicks = new ListID!(Tool)(10);
-  probes = new ListID!(Tool)(10);
-  repairs = new ListID!(Tool)(10);
-  cells = new CellList;
-  regions = new ListID!(Region)(20);
-  lights = new ListID!(Light)(1000);
-  skills = new SkillList;
-  soundGens = new ListID!(SoundGenerator)(500);
-  races = new ListID!(Race)(100);
-  miscItems = new ListID!(Misc)(700);
-  clothes = new ListID!(Clothing)(700);
-  ingreds = new ListID!(Ingredient)(200);
-  classes = new ListID!(Class)(100);
-  containers = new ListID!(Container)(1200);
-  creatures = new ListID!(Creature)(800);
-  itemLists = new ListID!(LeveledItems)(600);
-  creatureLists = new ListID!(LeveledCreatures)(400);
-  npcs = new ListID!(NPC)(3500);
-  dialogues = new ListID!(Dialogue)(3000);
-  startScripts.init();
-
-  hyperlinks.rehash(1600);
-
-  items.rehash(5500);
-  actors.rehash(5000);
-  cellRefs.rehash(17000);
-}
diff --git a/old_d_version/esmtool.d b/old_d_version/esmtool.d
deleted file mode 100644
index a43361803d..0000000000
--- a/old_d_version/esmtool.d
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (esmtool.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module esmtool;
-
-import std.stdio;
-
-import core.memory;
-import esm.esmmain;
-import monster.util.string;
-import mscripts.setup;
-
-import std.gc;
-import gcstats;
-
-
-// Not used, but we have to link it in along with the C++ stuff.
-import input.events;
-
-void poolSize()
-{
-  GCStats gc;
-  getStats(gc);
-  writefln("Pool size: ", comma(gc.poolsize));
-  writefln("Used size: ", comma(gc.usedsize));
-}
-
-//alias int[Dialogue*] TopicList;
-
-void main(char[][] args)
-{
-  char[][] files;
-  bool raw;
-
-  bool scptList; // List scripts
-  bool scptShow; // Show a script
-  char[] scptName; // Script to show
-
-  bool ciList; // List interior cells
-  bool ceList; // List exterior cells that have names
-
-  bool weList; // List weapons
-
-  bool gmst; // List game settings
-
-  bool numbers; // List how many there are of each record type
-
-  foreach(char[] a; args[1..$])
-    if(a == "-r") raw = true;
-
-    else if(a == "-sl") scptList = true;
-    else if(a == "-s") scptShow = true;
-    else if(scptShow && scptName == "") scptName = a;
-
-    else if(a == "-g") gmst = true;
-    else if(a == "-cil") ciList = true;
-    else if(a == "-cel") ceList = true;
-
-    else if(a == "-wl") weList = true;
-
-    else if(a == "-n") numbers = true;
-
-    else if(a.begins("-")) writefln("Ignoring unknown option %s", a);
-    else files ~= a;
-
-  int help(char[] msg)
-    {
-      writefln("%s", msg);
-      writefln("Syntax: %s [options] esm-file [esm-file ... ]", args[0]);
-      writefln("  Options:");
-      writefln("    -r            Display all records in raw format");
-      writefln("    -n            List the number of each record type");
-      writefln("    -sl           List scripts");
-      writefln("    -g            List game settings (GMST)");
-      writefln("    -s name       Show given script");
-      writefln("    -cil          List interior cells");
-      writefln("    -cel          List exterior cells with names");
-      writefln("    -wl           List weapons");
-      return 1;
-    }
-  if(files.length == 0) return help("No input files given");
-
-  if(scptShow && scptName == "") return help("No script name given");
-
-  initializeMemoryRegions();
-  initMonsterScripts();
-
-  if(raw)
-    {
-      foreach(int fileNum, char[] filename; files)
-	{
-	  try
-	    {
-	      esFile.open(filename, esmRegion);
-	      printRaw();
-	    }
-	  catch(Exception e)
-	    {
-	      try {writefln(e);}
-	      catch {}
-	      writefln("Error on file %s", filename);
-	    }
-	  catch
-	    {
-	      writefln("Error: Unkown failure on file %s", filename);
-	    }
-	}
-      return;
-    }
-
-  // Disable resource lookups.
-  resources.dummy = true;
-
-  try loadTESFiles(files);
-  catch(Exception e)
-    {
-      writefln(e);
-    }
-  catch { writefln("Error: Unkown failure"); }
-
-  // List weapons
-  if(weList) foreach(n, m; weapons.names)
-    {
-      alias Weapon.Type WT;
-      switch(m.data.type)
-	{
-	case WT.ShortBladeOneHand: writef("Short Sword"); break;
-	case WT.LongBladeOneHand: writef("Long Sword, One-Handed"); break;
-	case WT.LongBladeTwoHand: writef("Long Sword, Two-Handed"); break;
-	case WT.BluntOneHand: writef("Blunt, One-Handed"); break;
-	case WT.BluntTwoClose: writef("Blunt, Two-Handed"); break;
-	case WT.BluntTwoWide: writef("Blunt, Two-Handed Wide"); break;
-	case WT.SpearTwoWide: writef("Spear, Two-Handed"); break;
-	case WT.AxeOneHand: writef("Axe, One-Handed"); break;
-	case WT.AxeTwoHand: writef("Axe, Two-Handed"); break;
-	case WT.MarksmanBow: writef("Bow"); break;
-	case WT.MarksmanCrossbow: writef("Crossbow"); break;
-	case WT.MarksmanThrown: writef("Thrown weapon"); break;
-	case WT.Arrow: writef("Arrow"); break;
-	case WT.Bolt: writef("Bolt"); break;
-        default: assert(0);
-	}
-      writefln(" id '%s': name '%s'", n, m.name);
-
-      if(m.data.flags & Weapon.Flags.Magical)
-	writefln("Magical");
-      if(m.data.flags & Weapon.Flags.Silver)
-	writefln("Silver");
-
-      writefln("Weight: ", m.data.weight);
-      writefln("Value: ", m.data.value);
-      writefln("Health: ", m.data.health);
-      writefln("Speed: ", m.data.speed);
-      writefln("Reach: ", m.data.reach);
-      writefln("Enchantment points: ", m.data.enchant);
-      writefln("Combat: ", m.data.chop, m.data.slash, m.data.thrust);
-
-      if(m.enchant) writefln("Has enchantment '%s'", m.enchant.id);
-      if(m.script) writefln("Has script '%s'", m.script.id);
-
-      writefln();
-    }
-
-  if(numbers)
-    {
-      writefln("Activators: ", activators.length);
-      writefln("Doors: ", doors.length);
-      writefln("Globals: ", globals.length);
-      writefln("Sounds: ", sounds.length);
-      writefln("Game Settings: ", gameSettings.length);
-      writefln("Factions: ", factions.length);	
-      writefln("Statics: ", statics.length);
-      writefln("Spells: ", spells.length);
-      writefln("Potions: ", potions.length);
-      writefln("Apparatus: ", appas.length);
-      writefln("Armors: ", armors.length);
-      writefln("Body parts: ", bodyParts.length);
-      writefln("Enchantments: ", enchants.length);
-      writefln("Books: ", books.length);
-      writefln("Birth signs: ", birthSigns.length);
-      writefln("Land texture files: ", landTextures.length);
-      writefln("Weapons: ", weapons.length);
-      writefln("Lockpicks: ", lockpicks.length);
-      writefln("Probes: ", probes.length);
-      writefln("Repairs: ", repairs.length);
-      writefln("Cells: ", cells.length);
-      writefln("  Interior: ", cells.numInt);
-      writefln("  Exterior: ", cells.numExt);
-      writefln("Regions: ", regions.length);
-      writefln("Lights: ", lights.length);
-      writefln("Skills: ", skills.length);
-      writefln("Sound generators: ", soundGens.length);
-      writefln("Races: ", races.length);
-      writefln("Misc items: ", miscItems.length);
-      writefln("Cloths: ", clothes.length);
-      writefln("Ingredients: ", ingreds.length);
-      writefln("Classes: ", classes.length);
-      writefln("Containers: ", containers.length);
-      writefln("Creatures: ", creatures.length);
-      writefln("Leveled item lists: ", itemLists.length);
-      writefln("Leveled creature lists: ", creatureLists.length);
-      writefln("NPCs: ", npcs.length);
-      writefln("Scripts: ", scripts.length);
-      writefln("Dialogues: ", dialogues.length);
-      writefln("Hyperlinks: ", hyperlinks.list.length);
-      writefln("Start scripts: ", startScripts.length);
-      writefln("\nTotal items: ", items.length);
-      writefln("Total actors: ", actors.length);
-      writefln("Total cell placable items: ", cellRefs.length);
-    }
-  if(gmst)
-    {
-      foreach(a, b; gameSettings.names)
-        {
-          writef(a, " (");
-          if(b.type == VarType.Int) writefln("int) = ", b.i);
-          else if(b.type == VarType.Float) writefln("float) = ", b.f);
-          else if(b.type == VarType.String) writefln("string) = '%s'", b.str);
-          else writefln("no value)", cast(int)b.type);
-        }
-    }
-
-  if(scptList) foreach(a, b; scripts.names) writefln(a);
-  if(ciList)
-    foreach(a, b; cells.in_cells)
-      writefln(a);
-  if(ceList)
-    foreach(uint i, c; .cells.ex_cells)
-    {
-      int x, y;
-      CellList.decompound(i, x, y);
-      if(c.name.length)
-        writefln("%s,%s: %s", x, y, c.name);
-    }
-
-  if(scptShow)
-    {
-      Script *p = scripts.names.lookup(scptName);
-      if(p)
-	writefln("Script '%s', text is:\n-------\n%s\n-------", p.id, p.scriptText);
-      else writefln("Script '%s' not found", scptName);
-      writefln();
-    }
-
-  writefln(esmRegion);
-
-  poolSize();
-}
-
-// Quick function that simply iterates through an ES file and prints
-// out all the records and subrecords. Some of this code is really old
-// (about 2004-2005)
-void printRaw()
-{
-  with(esFile)
-    {
-      // Variable length integer (this only works for unsigned ints!)
-      ulong getHVUint()
-	{
-	  ulong l;
-
-	  getSubHeader();
-	  if( (getSubSize != 4) &&
-	      (getSubSize != 2) &&
-	      (getSubSize != 8) )
-	    fail(format("Unknown integer size: ", getSubSize));
-
-	  readExact(&l, getSubSize);
-	  return l;
-	}
-
-      writefln("Filename: ", getFilename);
-      writef("Filetype: ");
-      switch(getFileType())
-	{
-	case FileType.Plugin: writefln("Plugin"); break;
-	case FileType.Master: writefln("Master"); break;
-	case FileType.Savegame: writefln("Savegame"); break;
-	case FileType.Unknown: writefln("Unknown"); break;
-        default: assert(0);
-	}
-      writef("Version: ");
-      if(isVer12()) writefln("1.2");
-      else if(isVer13()) writefln("1.3");
-      else writefln("Unknown");
-      
-      writefln("Records: ", getRecords);
-      writefln("Master files:");
-      for(int i; i<getMasters.length; i++)
-	writefln("  %s", getMasters[i].name, ", ", getMasters[i].size, " bytes");
-      
-      writefln("Author: %s", getAuthor);
-      //writefln("Description: %s", desc);
-      writefln("Total file size: %d\n", getFileSize);
-      
-      writefln("List of records:");
-
-      while(hasMoreRecs())
-	{
-	  uint flags;
-	  
-	  // Read record header
-	  char[] recName = getRecName();
-	  getRecHeader(flags);
-	  
-	  if(flags)
-	    {
-	      writef("Flags: ");
-	      if(flags & RecordFlags.Persistent) writef("Persistent ");
-	      if(flags & RecordFlags.Blocked) writef("Blocked ");
-	      if(flags & RecordFlags.Flag6) writef("Flag6 ");
-	      if(flags & RecordFlags.Flag13) writef("Flag13 ");
-	      writefln();
-	      if(flags & RecordFlags.Unknown)
-		writefln("UNKNOWN flags are set: %xh", flags);
-	    }	
-	  
-	  // Process sub record
-	  writef("%s %d bytes", recName, getRecLeft());
-	  writefln();
-	  while(hasMoreSubs())
-	    {
-	      getSubName();
-	      char[] subName = retSubName();
-	      writef("   %s = ", subName);
-
-	      // Process header
-	      if(subName == "NAME" || subName == "STRV" ||
-		 subName == "FNAM" || subName == "MODL" ||
-		 subName == "SCRI" || subName == "RGNN" ||
-		 subName == "BNAM" || subName == "ONAM" ||
-		 subName == "INAM" || subName == "SCVR" ||
-		 subName == "RNAM" || subName == "DNAM" ||
-		 subName == "ANAM")
-		//subName == "SCTX") // For script text
-		//getHString();
-		{
-		  writefln("'%s'", getHString());
-		}
-	      else if(subName == "FLTV" || subName == "XSCL")
-                {
-                  float f = getHFloat();
-                  writefln("f=", f, " i=", *(cast(int*)&f));
-                }
-	      else if(subName == "INTV" /*|| subName == "NAM0"*/ || subName == "FRMR")
-		writefln(getHVUint());
-	      else
-		{
-		  int left = skipHSub();
-		  writefln(left, " bytes");
-		}
-	    }
-	  writefln();
-	}
-    }
-}
-
diff --git a/old_d_version/input/events.d b/old_d_version/input/events.d
deleted file mode 100644
index 4c5d570e79..0000000000
--- a/old_d_version/input/events.d
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (events.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module input.events;
-
-import std.stdio;
-import std.string;
-
-import sound.audio;
-
-import core.config;
-
-import scene.soundlist;
-import scene.player;
-
-import bullet.bindings;
-
-import monster.monster;
-import monster.vm.dbg;
-
-import ogre.bindings;
-import gui.bindings;
-import gui.gui;
-
-import input.keys;
-import input.ois;
-
-// Debug output
-//debug=printMouse;      // Mouse button events
-//debug=printMouseMove;  // Mouse movement events
-//debug=printKeys;       // Keypress events
-
-// TODO: Jukebox controls and other state-related data will later be
-// handled entirely in script code, as will some of the key bindings.
-
-// Pause?
-bool pause = false;
-int *guiMode;
-
-const float volDiff = 0.05;
-
-void musVolume(bool increase)
-{
-  float diff = -volDiff;
-  if(increase) diff = -diff;
-  config.setMusicVolume(diff + config.getMusicVolume);
-  writefln(increase?"Increasing":"Decreasing", " music volume to ", config.getMusicVolume);
-}
-
-void sfxVolume(bool increase)
-{
-  float diff = -volDiff;
-  if(increase) diff = -diff;
-  config.setSfxVolume(diff + config.getSfxVolume);
-  writefln(increase?"Increasing":"Decreasing", " sound effect volume to ", config.getSfxVolume);
-}
-
-void mainVolume(bool increase)
-{
-  float diff = -volDiff;
-  if(increase) diff = -diff;
-  config.setMainVolume(diff + config.getMainVolume);
-  writefln(increase?"Increasing":"Decreasing", " main volume to ", config.getMainVolume);
-}
-
-void updateMouseSensitivity()
-{
-  effMX = *config.mouseSensX;
-  effMY = *config.mouseSensY;
-  if(*config.flipMouseY) effMY = -effMY;
-}
-
-void togglePause()
-{
-  pause = !pause;
-  if(pause) writefln("Pause");
-  else writefln("Pause off");
-}
-
-extern(C) void d_handleMouseButton(MouseState *state, int button)
-{
-  debug(printMouse)
-    writefln("handleMouseButton %s: Abs(%s, %s, %s)", button, 
-             state.X.abs, state.Y.abs, state.Z.abs);
-
-  // For the moment, just treat mouse clicks as normal key presses.
-  d_handleKey(cast(KC) (KC.Mouse0 + button));
-}
-
-// Handle a keyboard event through key bindings. Direct movement
-// (eg. arrow keys) is not handled here, see d_frameStarted() below.
-extern(C) void d_handleKey(KC keycode, dchar text = 0)
-{
-  // Do some preprocessing on the data to account for OIS
-  // shortcommings.
-
-  // Some keys (especially international keys) have no key code but
-  // return a character instead.
-  if(keycode == 0)
-    {
-      // If no character is given, just drop this event since OIS did
-      // not manage to give us any useful data at all.
-      if(text == 0) return;
-
-      keycode = KC.CharOnly;
-    }
-
-  // Debug output
-  debug(printKeys)
-    {
-      char[] str;
-      if(keycode >= 0 && keycode < keysymToString.length)
-        str = keysymToString[keycode];
-      else str = "OUT_OF_RANGE";
-      writefln("Key %s, text '%s', name '%s'", keycode, text, str);
-    }
-
-  // Look up the key binding. We have to send both the keycode and the
-  // text.
-  Keys k = keyBindings.findMatch(keycode, text);
-
-  // These are handled even if we are in gui mode:
-  if(k)
-    switch(k)
-      {
-      case Keys.ToggleGui: gui_toggleGui(); return;
-      case Keys.Console: gui_toggleConsole(); return;
-      case Keys.ScreenShot: takeScreenShot(); return;
-      default:
-      }
-
-  if(*guiMode) return;
-
-  if(k)
-    switch(k)
-      {
-      case Keys.ToggleBattleMusic:
-        Music.toggle();
-        return;
-
-      case Keys.MainVolUp: mainVolume(true); return;
-      case Keys.MainVolDown: mainVolume(false); return;
-      case Keys.MusVolUp: musVolume(true); return;
-      case Keys.MusVolDown: musVolume(false); return;
-      case Keys.SfxVolUp: sfxVolume(true); return;
-      case Keys.SfxVolDown: sfxVolume(false); return;
-      case Keys.Mute: Music.toggleMute(); return;
-      case Keys.Fullscreen: toggleFullscreen(); return;
-
-      case Keys.PhysMode: bullet_nextMode(); return;
-      case Keys.Nighteye: ogre_toggleLight(); return;
-
-      case Keys.Debug: return;
-      case Keys.Pause: togglePause(); return;
-      case Keys.Exit: exitProgram(); return;
-      default:
-        assert(k >= 0 && k < keyToString.length);
-        writefln("WARNING: Event %s has no effect", keyToString[k]);
-      }
-  return;
-}
-
-// Refresh rate for sfx placements, in seconds.
-const float sndRefresh = 0.17;
-
-// Refresh rate for music fadeing, seconds.
-const float musRefresh = 0.05;
-
-// Walking / floating speed, in points per second.
-float speed = 300;
-
-float sndCumTime = 0;
-float musCumTime = 0;
-
-// Move the player according to playerData.position
-void movePlayer()
-{
-  // Move the player into place. TODO: This isn't really input-related
-  // at all, and should be moved.
-  with(*playerData.position)
-    {
-      ogre_moveCamera(position[0], position[1], position[2]);
-      ogre_setCameraRotation(rotation[0], rotation[1], rotation[2]);
-
-      bullet_movePlayer(position[0], position[1], position[2]);
-    }
-}
-
-void initializeInput()
-{
-  movePlayer();
-
-  // TODO/FIXME: This should have been in config, but DMD's module
-  // system is on the brink of collapsing, and it won't compile if I
-  // put another import in core.config. I should probably check the
-  // bug list and report it.
-  updateMouseSensitivity();
-
-  // Get a pointer to the 'guiMode' flag in cpp_ogre.cpp
-  guiMode = gui_getGuiModePtr();
-}
-
-extern(C) int ois_isPressed(int keysym);
-
-// Check if a key is currently down
-bool isPressed(Keys key)
-{
-  KeyBind *b = &keyBindings.bindings[key];
-  foreach(i; b.syms)
-    if(i != 0 && ois_isPressed(i)) return true;
-  return false;
-}
-
-// Enable superman mode, ie. flight and super-speed. Only used for
-// debugging the terrain mode.
-extern(C) void d_terr_superman()
-{
-  bullet_fly();
-  speed = 8000;
-
-  with(*playerData.position)
-    {
-      position[0] = 20000;
-      position[1] = -70000;
-      position[2] = 30000;
-    }
-  movePlayer();
-}
-
-extern(C) int d_frameStarted(float time)
-{
-  if(doExit) return 0;
-
-  dbg.trace("d_frameStarted");
-  scope(exit) dbg.untrace();
-
-  // Run the Monster scheduler
-  vm.frame(time);
-
-  musCumTime += time;
-  if(musCumTime > musRefresh)
-    {
-      Music.updateBuffers();
-      musCumTime -= musRefresh;
-    }
-
-  // The rest is ignored in pause or GUI mode
-  if(pause || *guiMode > 0) return 1;
-
-  // Check if the movement keys are pressed
-  float moveX = 0, moveY = 0, moveZ = 0;
-  float x, y, z, ox, oy, oz;
-
-  if(isPressed(Keys.MoveLeft)) moveX -= speed;
-  if(isPressed(Keys.MoveRight)) moveX += speed;
-  if(isPressed(Keys.MoveForward)) moveZ -= speed;
-  if(isPressed(Keys.MoveBackward)) moveZ += speed;
-
-  // TODO: These should be enabled for floating modes (like swimming
-  // and levitation) and disabled for everything else.
-  if(isPressed(Keys.MoveUp)) moveY += speed;
-  if(isPressed(Keys.MoveDown)) moveY -= speed;
-
-  // This isn't very elegant, but it's simple and it works.
-
-  // Get the current coordinates
-  ogre_getCameraPos(&ox, &oy, &oz);
-
-  // Move camera using relative coordinates. TODO: We won't really
-  // need to move the camera here (since it's moved below anyway), we
-  // only want the transformation from camera space to world
-  // space. This can likely be done more efficiently.
-  ogre_moveCameraRel(moveX, moveY, moveZ);
-
-  // Get the result
-  ogre_getCameraPos(&x, &y, &z);
-
-  // The result is the real movement direction, in world coordinates
-  moveX = x-ox;
-  moveY = y-oy;
-  moveZ = z-oz;
-
-  // Tell Bullet that this is where we want to go
-  bullet_setPlayerDir(moveX, moveY, moveZ);
-
-  // Perform a Bullet time step
-  bullet_timeStep(time);
-
-  // Get the final (actual) player position and update the camera
-  bullet_getPlayerPos(&x, &y, &z);
-  ogre_moveCamera(x,y,z);
-
-  // Store it in the player object
-  playerData.position.position[0] = x;
-  playerData.position.position[1] = y;
-  playerData.position.position[2] = z;
-
-  if(!config.noSound)
-    {
-      // Tell the sound scene that the player has moved
-      sndCumTime += time;
-      if(sndCumTime > sndRefresh)
-        {
-          float fx, fy, fz;
-          float ux, uy, uz;
-
-          ogre_getCameraOrientation(&fx, &fy, &fz, &ux, &uy, &uz);
-
-          soundScene.update(x,y,z,fx,fy,fz,ux,uy,uz);
-          sndCumTime -= sndRefresh;
-        }
-    }
-  return 1;
-}
-
-bool collides = false;
diff --git a/old_d_version/input/ois.d b/old_d_version/input/ois.d
deleted file mode 100644
index 60129cadf2..0000000000
--- a/old_d_version/input/ois.d
+++ /dev/null
@@ -1,428 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (ois.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module input.ois;
-
-// Mouse buttons
-enum MB : int
-  {
-    Button0     = 0,
-    Left        = Button0,
-    Button1     = 1,
-    Right       = Button1,
-    Button2     = 2,
-    Middle      = Button2,
-
-    Button3     = 3,
-    Button4     = 4,
-    Button5     = 5,
-    Button6     = 6,
-    Button7     = 7,
-
-    LastMouse
-  }
-
-	// Keyboard scan codes
-enum KC : int
-  {
-    UNASSIGNED  = 0x00,
-    ESCAPE      = 0x01,
-    N1          = 0x02,
-    N2          = 0x03,
-    N3          = 0x04,
-    N4          = 0x05,
-    N5          = 0x06,
-    N6          = 0x07,
-    N7          = 0x08,
-    N8          = 0x09,
-    N9          = 0x0A,
-    N0          = 0x0B,
-    MINUS       = 0x0C,    // - on main keyboard
-    EQUALS      = 0x0D,
-    BACK        = 0x0E,    // backspace
-    TAB         = 0x0F,
-    Q           = 0x10,
-    W           = 0x11,
-    E           = 0x12,
-    R           = 0x13,
-    T           = 0x14,
-    Y           = 0x15,
-    U           = 0x16,
-    I           = 0x17,
-    O           = 0x18,
-    P           = 0x19,
-    LBRACKET    = 0x1A,
-    RBRACKET    = 0x1B,
-    RETURN      = 0x1C,    // Enter on main keyboard
-    LCONTROL    = 0x1D,
-    A           = 0x1E,
-    S           = 0x1F,
-    D           = 0x20,
-    F           = 0x21,
-    G           = 0x22,
-    H           = 0x23,
-    J           = 0x24,
-    K           = 0x25,
-    L           = 0x26,
-    SEMICOLON   = 0x27,
-    APOSTROPHE  = 0x28,
-    GRAVE       = 0x29,    // accent
-    LSHIFT      = 0x2A,
-    BACKSLASH   = 0x2B,
-    Z           = 0x2C,
-    X           = 0x2D,
-    C           = 0x2E,
-    V           = 0x2F,
-    B           = 0x30,
-    N           = 0x31,
-    M           = 0x32,
-    COMMA       = 0x33,
-    PERIOD      = 0x34,    // . on main keyboard
-    SLASH       = 0x35,    // / on main keyboard
-    RSHIFT      = 0x36,
-    MULTIPLY    = 0x37,    // * on numeric keypad
-    LMENU       = 0x38,    // left Alt
-    SPACE       = 0x39,
-    CAPITAL     = 0x3A,
-    F1          = 0x3B,
-    F2          = 0x3C,
-    F3          = 0x3D,
-    F4          = 0x3E,
-    F5          = 0x3F,
-    F6          = 0x40,
-    F7          = 0x41,
-    F8          = 0x42,
-    F9          = 0x43,
-    F10         = 0x44,
-    NUMLOCK     = 0x45,
-    SCROLL      = 0x46,    // Scroll Lock
-    NUMPAD7     = 0x47,
-    NUMPAD8     = 0x48,
-    NUMPAD9     = 0x49,
-    SUBTRACT    = 0x4A,    // - on numeric keypad
-    NUMPAD4     = 0x4B,
-    NUMPAD5     = 0x4C,
-    NUMPAD6     = 0x4D,
-    ADD         = 0x4E,    // + on numeric keypad
-    NUMPAD1     = 0x4F,
-    NUMPAD2     = 0x50,
-    NUMPAD3     = 0x51,
-    NUMPAD0     = 0x52,
-    DECIMAL     = 0x53,    // . on numeric keypad
-    OEM_102     = 0x56,    // < > | on UK/Germany keyboards
-    F11         = 0x57,
-    F12         = 0x58,
-    F13         = 0x64,    //                     (NEC PC98)
-    F14         = 0x65,    //                     (NEC PC98)
-    F15         = 0x66,    //                     (NEC PC98)
-    KANA        = 0x70,    // (Japanese keyboard)
-    ABNT_C1     = 0x73,    // / ? on Portugese (Brazilian) keyboards
-    CONVERT     = 0x79,    // (Japanese keyboard)
-    NOCONVERT   = 0x7B,    // (Japanese keyboard)
-    YEN         = 0x7D,    // (Japanese keyboard)
-    ABNT_C2     = 0x7E,    // Numpad . on Portugese (Brazilian) keyboards
-    NUMPADEQUALS= 0x8D,    // = on numeric keypad (NEC PC98)
-    PREVTRACK   = 0x90,    // Previous Track (CIRCUMFLEX on Japanese keyboard)
-    AT          = 0x91,    //                     (NEC PC98)
-    COLON       = 0x92,    //                     (NEC PC98)
-    UNDERLINE   = 0x93,    //                     (NEC PC98)
-    KANJI       = 0x94,    // (Japanese keyboard)
-    STOP        = 0x95,    //                     (NEC PC98)
-    AX          = 0x96,    //                     (Japan AX)
-    UNLABELED   = 0x97,    //                        (J3100)
-    NEXTTRACK   = 0x99,    // Next Track
-    NUMPADENTER = 0x9C,    // Enter on numeric keypad
-    RCONTROL    = 0x9D,
-    MUTE        = 0xA0,    // Mute
-    CALCULATOR  = 0xA1,    // Calculator
-    PLAYPAUSE   = 0xA2,    // Play / Pause
-    MEDIASTOP   = 0xA4,    // Media Stop
-    VOLUMEDOWN  = 0xAE,    // Volume -
-    VOLUMEUP    = 0xB0,    // Volume +
-    WEBHOME     = 0xB2,    // Web home
-    NUMPADCOMMA = 0xB3,    // , on numeric keypad (NEC PC98)
-    DIVIDE      = 0xB5,    // / on numeric keypad
-    SYSRQ       = 0xB7,    // Also called print screen
-    RMENU       = 0xB8,    // right Alt
-    PAUSE       = 0xC5,    // Pause
-    HOME        = 0xC7,    // Home on arrow keypad
-    UP          = 0xC8,    // UpArrow on arrow keypad
-    PGUP        = 0xC9,    // PgUp on arrow keypad
-    LEFT        = 0xCB,    // LeftArrow on arrow keypad
-    RIGHT       = 0xCD,    // RightArrow on arrow keypad
-    END         = 0xCF,    // End on arrow keypad
-    DOWN        = 0xD0,    // DownArrow on arrow keypad
-    PGDOWN      = 0xD1,    // PgDn on arrow keypad
-    INSERT      = 0xD2,    // Insert on arrow keypad
-    DELETE      = 0xD3,    // Delete on arrow keypad
-    LWIN        = 0xDB,    // Left Windows key
-    RWIN        = 0xDC,    // Right Windows key
-    APPS        = 0xDD,    // AppMenu key
-    POWER       = 0xDE,    // System Power
-    SLEEP       = 0xDF,    // System Sleep
-    WAKE        = 0xE3,    // System Wake
-    WEBSEARCH   = 0xE5,    // Web Search
-    WEBFAVORITES= 0xE6,    // Web Favorites
-    WEBREFRESH  = 0xE7,    // Web Refresh
-    WEBSTOP     = 0xE8,    // Web Stop
-    WEBFORWARD  = 0xE9,    // Web Forward
-    WEBBACK     = 0xEA,    // Web Back
-    MYCOMPUTER  = 0xEB,    // My Computer
-    MAIL        = 0xEC,    // Mail
-    MEDIASELECT = 0xED,    // Media Select
-
-    CharOnly    = 0xFF,    // Set when the keysym is 0 but the
-                           // character is set. This happens with many
-                           // international characters or reassigned
-                           // characters.
-
-    Mouse0      = 0x100,   // Mouse button events can be handled as
-    Mouse1      = 0x101,   // keypresses too.
-    Mouse2      = 0x102,
-    Mouse3      = 0x103,
-    Mouse4      = 0x104,
-    Mouse5      = 0x105,
-    Mouse6      = 0x106,
-    Mouse7      = 0x107,
-  }
-
-// Sigh. I guess we have to do this for Monster at some poing anyway,
-// so this work isn't completely wasted. Later we can make a generic
-// conversion between OIS-keysyms, SDL-keysyms and others to the
-// Monster keysyms. It sucks that everybody tries to reinvent the
-// wheel as often as they can, but that's the way it goes.
-
-const char[][] keysymToString =
-[
-    KC.UNASSIGNED  : "UNASSIGNED",
-    KC.ESCAPE      : "escape",
-    KC.N1          : "1",
-    KC.N2          : "2",
-    KC.N3          : "3",
-    KC.N4          : "4",
-    KC.N5          : "5",
-    KC.N6          : "6",
-    KC.N7          : "7",
-    KC.N8          : "8",
-    KC.N9          : "9",
-    KC.N0          : "0",
-    KC.MINUS       : "minus",
-    KC.EQUALS      : "equals",
-    KC.BACK        : "backspace",
-    KC.TAB         : "tab",
-    KC.Q           : "q",
-    KC.W           : "w",
-    KC.E           : "e",
-    KC.R           : "r",
-    KC.T           : "t",
-    KC.Y           : "y",
-    KC.U           : "u",
-    KC.I           : "i",
-    KC.O           : "o",
-    KC.P           : "p",
-    KC.LBRACKET    : "{",
-    KC.RBRACKET    : "}",
-    KC.RETURN      : "enter",
-    KC.LCONTROL    : "left_ctrl",
-    KC.A           : "a",
-    KC.S           : "s",
-    KC.D           : "d",
-    KC.F           : "f",
-    KC.G           : "g",
-    KC.H           : "h",
-    KC.J           : "j",
-    KC.K           : "k",
-    KC.L           : "l",
-    KC.SEMICOLON   : "semicolon",
-    KC.APOSTROPHE  : "apostrophe",
-    KC.GRAVE       : "grave",
-    KC.LSHIFT      : "left_shift",
-    KC.BACKSLASH   : "backslash",
-    KC.Z           : "z",
-    KC.X           : "x",
-    KC.C           : "c",
-    KC.V           : "v",
-    KC.B           : "b",
-    KC.N           : "n",
-    KC.M           : "m",
-    KC.COMMA       : "comma",
-    KC.PERIOD      : "period",
-    KC.SLASH       : "slash",
-    KC.RSHIFT      : "right_shift",
-    KC.MULTIPLY    : "numpad_mult",
-    KC.LMENU       : "left_alt",
-    KC.SPACE       : "space",
-    KC.CAPITAL     : "capital",
-    KC.F1          : "f1",
-    KC.F2          : "f2",
-    KC.F3          : "f3",
-    KC.F4          : "f4",
-    KC.F5          : "f5",
-    KC.F6          : "f6",
-    KC.F7          : "f7",
-    KC.F8          : "f8",
-    KC.F9          : "f9",
-    KC.F10         : "f10",
-    KC.NUMLOCK     : "numlock",
-    KC.SCROLL      : "scroll",
-    KC.NUMPAD7     : "numpad_7",
-    KC.NUMPAD8     : "numpad_8",
-    KC.NUMPAD9     : "numpad_9",
-    KC.SUBTRACT    : "numpad_minus",
-    KC.NUMPAD4     : "numpad_4",
-    KC.NUMPAD5     : "numpad_5",
-    KC.NUMPAD6     : "numpad_6",
-    KC.ADD         : "numpad_plus",
-    KC.NUMPAD1     : "numpad_1",
-    KC.NUMPAD2     : "numpad_2",
-    KC.NUMPAD3     : "numpad_3",
-    KC.NUMPAD0     : "numpad_0",
-    KC.DECIMAL     : "numpad_period",
-    KC.OEM_102     : "oem102",
-    KC.F11         : "f11",
-    KC.F12         : "f12",
-    KC.F13         : "f13",
-    KC.F14         : "f14",
-    KC.F15         : "f15",
-    KC.KANA        : "kana",
-    KC.ABNT_C1     : "abnt_c1",
-    KC.CONVERT     : "convert",
-    KC.NOCONVERT   : "noconvert",
-    KC.YEN         : "yen",
-    KC.ABNT_C2     : "abnt_c2",
-    KC.NUMPADEQUALS: "numpad_equals",
-    KC.PREVTRACK   : "prev_track",
-    KC.AT          : "at",
-    KC.COLON       : "colon",
-    KC.UNDERLINE   : "underline",
-    KC.KANJI       : "kanji",
-    KC.STOP        : "stop",
-    KC.AX          : "ax",
-    KC.UNLABELED   : "unlabeled",
-    KC.NEXTTRACK   : "next_track",
-    KC.NUMPADENTER : "numpad_enter",
-    KC.RCONTROL    : "right_control",
-    KC.MUTE        : "mute",
-    KC.CALCULATOR  : "calculator",
-    KC.PLAYPAUSE   : "play_pause",
-    KC.MEDIASTOP   : "media_stop",
-    KC.VOLUMEDOWN  : "volume_down",
-    KC.VOLUMEUP    : "volume_up",
-    KC.WEBHOME     : "webhome",
-    KC.NUMPADCOMMA : "numpad_comma",
-    KC.DIVIDE      : "numpad_divide",
-    KC.SYSRQ       : "print_screen",
-    KC.RMENU       : "right_alt",
-    KC.PAUSE       : "pause",
-    KC.HOME        : "home",
-    KC.UP          : "up",
-    KC.PGUP        : "page_up",
-    KC.LEFT        : "left",
-    KC.RIGHT       : "right",
-    KC.END         : "end",
-    KC.DOWN        : "down",
-    KC.PGDOWN      : "page_down",
-    KC.INSERT      : "insert",
-    KC.DELETE      : "delete",
-    KC.LWIN        : "left_win",
-    KC.RWIN        : "right_win",
-    KC.APPS        : "app_menu",
-    KC.POWER       : "power",
-    KC.SLEEP       : "sleep",
-    KC.WAKE        : "wake",
-    KC.WEBSEARCH   : "web_search",
-    KC.WEBFAVORITES: "web_favorites",
-    KC.WEBREFRESH  : "web_refresh",
-    KC.WEBSTOP     : "web_stop",
-    KC.WEBFORWARD  : "web_forward",
-    KC.WEBBACK     : "web_back",
-    KC.MYCOMPUTER  : "my_computer",
-    KC.MAIL        : "mail",
-    KC.MEDIASELECT : "media_select",
-
-
-    KC.CharOnly    : "CHAR_ONLY",  // Set when the keysym is 0 but the
-                                   // character is set. This happens
-                                   // with many international
-                                   // characters or reassigned
-                                   // characters in OIS (and it
-                                   // SUCKS.)
-
-    KC.Mouse0      : "mouse0",
-    KC.Mouse1      : "mouse1",
-    KC.Mouse2      : "mouse2",
-    KC.Mouse3      : "mouse3",
-    KC.Mouse4      : "mouse4",
-    KC.Mouse5      : "mouse5",
-    KC.Mouse6      : "mouse6",
-    KC.Mouse7      : "mouse7",
- ];
-
-enum ComponentType : int
-  {
-    Unknown = 0,
-    Button  = 1, // ie. Key, mouse button, joy button, etc
-    Axis    = 2, // ie. A joystick or mouse axis
-    Slider  = 3, //
-    POV     = 4, // ie. Arrow direction keys
-    Vector3 = 5  // ie. WiiMote orientation
-  }
-
-align(4) struct Axis
-{
-  ComponentType type;
-  int abs, rel;
-  bool absOnly;
-}
-
-// The C++ size of Axis is 16
-static assert(Axis.sizeof == 16);
-
-struct MouseState
-{
-  /* Represents the height/width of your display area.. used if mouse
-     clipping or mouse grabbed in case of X11 - defaults to 50.. Make
-     sure to set this and change when your size changes.. */
-  int width, height;
-
-  // X Axis component
-  Axis X;
-
-  // Y Axis Component
-  Axis Y;
-
-  // Z Axis Component
-  Axis Z;
-
-  // represents all buttons - bit position indicates button down
-  int buttons;
-
-  // Button down test
-  bool buttonDown( MB button )
-  {
-    return (buttons & ( 1 << button )) != 0;
-  }
-}
-
-// Check that we match the C++ size
-static assert(MouseState.sizeof == 60);
diff --git a/old_d_version/ogre/cpp_framelistener.cpp b/old_d_version/ogre/cpp_framelistener.cpp
deleted file mode 100644
index 8c7a370441..0000000000
--- a/old_d_version/ogre/cpp_framelistener.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// Get current camera orientation, in the form of 'front' and 'up'
-// vectors.
-extern "C" void ogre_getCameraOrientation(float *fx, float *fy, float *fz,
-                                         float *ux, float *uy, float *uz)
-{
-  Vector3 front = mCamera->getDirection();
-  Vector3 up = mCamera->getUp();
-  *fx = front[0];
-  *fy = -front[2];
-  *fz = front[1];
-  *ux = up[0];
-  *uy = -up[2];
-  *uz = up[1];
-}
-
-// Move camera
-extern "C" void ogre_moveCamera(float x, float y, float z)
-{
-  // Transforms Morrowind coordinates to OGRE coordinates. The camera
-  // is not affected by the rotation of the root node, so we must
-  // transform this manually.
-  mCamera->setPosition(Vector3(x,z+90,-y));
-}
-
-// Rotate camera using Morrowind rotation specifiers
-extern "C" void ogre_setCameraRotation(float r1, float r2, float r3)
-{
-  // TODO: This translation is probably not correct, but for now I
-  // have no reference point. Fix it later when we teleport from one
-  // cell to another, so we have something to compare against.
-
-  // Rotate around X axis
-  Quaternion xr(Radian(-r1), Vector3::UNIT_X);
-  // Rotate around Y axis
-  Quaternion yr(Radian(r3+3.14), Vector3::UNIT_Y);
-  // Rotate around Z axis
-  Quaternion zr(Radian(-r2), Vector3::UNIT_Z);
-
-  // Rotates first around z, then y, then x
-  mCamera->setOrientation(xr*yr*zr);
-}
diff --git a/old_d_version/ogre/cpp_interface.cpp b/old_d_version/ogre/cpp_interface.cpp
deleted file mode 100644
index 98df9125e0..0000000000
--- a/old_d_version/ogre/cpp_interface.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copy a scene node and all its children
-void cloneNode(SceneNode *from, SceneNode *to, char* name)
-{
-  to->setPosition(from->getPosition());
-  to->setOrientation(from->getOrientation());
-  to->setScale(from->getScale());
-
-  SceneNode::ObjectIterator it = from->getAttachedObjectIterator();
-  while(it.hasMoreElements())
-    {
-      // We can't handle non-entities.
-      Entity *e = dynamic_cast<Entity*> (it.getNext());
-      if(e)
-        {
-          e = e->clone(String(name) + ":" + e->getName());
-          to->attachObject(e);
-        }
-    }
-
-  // Recursively clone all child nodes
-  SceneNode::ChildNodeIterator it2 = from->getChildIterator();
-  while(it2.hasMoreElements())
-    {
-      cloneNode((SceneNode*)it2.getNext(), to->createChildSceneNode(), name);
-    }
-}
-
-// Supposed to insert a copy of the node, for now it just inserts the
-// actual node.
-extern "C" SceneNode *ogre_insertNode(SceneNode *base, char* name,
-                                      float *pos, float *quat,
-                                      float scale)
-{
-  //std::cout << "ogre_insertNode(" << name << ")\n";
-  SceneNode *node = mwRoot->createChildSceneNode(name);
-
-  // Make a copy of the node
-  cloneNode(base, node, name);
-
-  // Apply transformations
-  node->setPosition(pos[0], pos[1], pos[2]);
-  node->setOrientation(quat[0], quat[1], quat[2], quat[3]);
-
-  node->setScale(scale, scale, scale);
-
-  return node;
-}
-
-// Get the world transformation of a node (the total transformation of
-// this node and all parent nodes). Return it as a translation
-// (3-vector) and a rotation / scaling part (3x3 matrix)
-extern "C" void ogre_getWorldTransform(SceneNode *node,
-                                       float *trans, // Storage for translation
-                                       float *matrix)// For 3x3 matrix
-{
-  // Get the world transformation first
-  Matrix4 trafo;
-  node->getWorldTransforms(&trafo);
-
-  // Extract the translation part and pass it to the caller
-  Vector3 tr = trafo.getTrans();
-  trans[0] = tr[0];
-  trans[1] = tr[1];
-  trans[2] = tr[2];
-
-  // Next extract the matrix
-  Matrix3 mat;
-  trafo.extract3x3Matrix(mat);
-  matrix[0] = mat[0][0];
-  matrix[1] = mat[0][1];
-  matrix[2] = mat[0][2];
-  matrix[3] = mat[1][0];
-  matrix[4] = mat[1][1];
-  matrix[5] = mat[1][2];
-  matrix[6] = mat[2][0];
-  matrix[7] = mat[2][1];
-  matrix[8] = mat[2][2];
-}
-
-// Create the water plane. It doesn't really resemble "water" yet
-// though.
-extern "C" void ogre_createWater(float level)
-{
-    // Create a plane aligned with the xy-plane.
-    MeshManager::getSingleton().createPlane("water",
-           ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
-           Plane(Vector3::UNIT_Z, level),
-	   150000,150000
-	   );
-    Entity *ent = mSceneMgr->createEntity( "WaterEntity", "water" );
-    mwRoot->createChildSceneNode()->attachObject(ent);
-    ent->setCastShadows(false);
-}
-
-extern "C" SceneNode *ogre_getDetachedNode()
-{
-  SceneNode *node = mwRoot->createChildSceneNode();
-  mwRoot->removeChild(node);
-  return node;
-}
-
-extern "C" SceneNode* ogre_createNode(
-		char *name,
-		float *trafo,
-		SceneNode *parent,
-		int32_t noRot)
-{
-  //std::cout << "ogre_createNode(" << name << ")";
-  SceneNode *node = parent->createChildSceneNode(name);
-  //std::cout << " ... done\n";
-
-  // First is the translation vector
-
-  // TODO should be "if(!noRot)" only for exterior cells!? Yay for
-  // consistency. Apparently, the displacement of the base node in NIF
-  // files must be ignored for meshes in interior cells, but not for
-  // exterior cells. Or at least that's my hypothesis, and it seems
-  // work. There might be some other NIF trickery going on though, you
-  // never know when you're reverse engineering someone else's file
-  // format. We will handle this later.
-  if(!noRot)
-    node->setPosition(trafo[0], trafo[1], trafo[2]);
-
-  // Then a 3x3 rotation matrix.
-  if(!noRot)
-    node->setOrientation(Quaternion(Matrix3(trafo[3], trafo[4], trafo[5],
-					    trafo[6], trafo[7], trafo[8],
-					    trafo[9], trafo[10], trafo[11]
-					    )));
-
-  // Scale is at the end
-  node->setScale(trafo[12],trafo[12],trafo[12]);
-
-  return node;
-}
diff --git a/old_d_version/ogre/meshloader.d b/old_d_version/ogre/meshloader.d
deleted file mode 100644
index 5065cc87a9..0000000000
--- a/old_d_version/ogre/meshloader.d
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (meshloader.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module ogre.meshloader;
-
-import std.stdio;
-import std.stream;
-
-import nif.nif;
-import nif.record;
-
-import core.resource;
-import ogre.bindings;
-
-import bullet.bindings;
-
-import util.uniquename;
-
-/*
- There are some problems that will have to be looked into later:
-
- - Some meshes crash Ogre when shadows are turned on. (Not tested in
-   newer versions of Ogre). Shadows are completely disabled for now.
- - There are obviously some boundry problems, some times the mesh
-   disappears even though some part of it is inside the screen. This
-   is especially a problem with animated meshes, since the animation
-   might step outside the original bounding box.
- */
-
-MeshLoader meshLoader;
-
-struct MeshLoader
-{
-  // Not sure how to handle the bounding box, just ignore it for now.
-
-  char[] baseName; // NIF file name. Used in scene node names etc. so
-		   // that we can identify where they came from in
-		   // case of error messages.
-
-  // Load a NIF mesh. Assumes nifMesh is already opened. This creates
-  // a "template" scene node containing this mesh, and removes it from
-  // the main scene. This node can later be "cloned" so that multiple
-  // instances of the object can be inserted into the world without
-  // inserting the mesh more than once.
-  void loadMesh(char[] name, out NodePtr base, out BulletShape shape)
-  {
-    baseName = name;
-
-    // Check if the first record is a node
-    Node n = cast(Node) nifMesh.records[0];
-
-    if(n is null)
-      {
-	// TODO: Figure out what to do in this case, we should
-	// probably throw.
-        writefln("NIF '%s' IS NOT A MESH", name);
-	return;
-      }
-
-    // Get a fresh SceneNode and detatch it from the root. We use this
-    // as the base for our mesh.
-    base = ogre_getDetachedNode();
-
-    // Recursively insert nodes (don't rotate the first node)
-    insertNode(n, base, 0, true);
-
-    // Get the final shape, if any
-    shape = bullet_getFinalShape();
-
-    return base;
-  }
-
-  private:
-
-  void insertNode(Node data, NodePtr parent,
-                  int flags,
-                  bool noRot = false)
-  {
-    // Add the flags to the previous node's flags
-    flags = data.flags | flags;
-
-    // Create a scene node, move and rotate it into place. The name
-    // must be unique, however we might have to recognize some special
-    // names later, in order to attach arms and legs on NPCs
-    // etc. Always ignore transformation of the first node? This is a
-    // problem, I don't know when to do this and when not to. Neither
-    // is always right. Update: I originally thought noRot should be
-    // false for exteriors and true for interiors, but this isn't so.
-    NodePtr node = ogre_createNode(UniqueName(data.name).ptr, &data.trafo,
-				  parent, cast(int)noRot);
-
-    // Handle any general properties here
-
-    // Call functions that do node-specific things, like handleNiNode
-    // or handleNiTriShape.
-    {
-      NiNode n = cast(NiNode)data;
-      if(n !is null)
-	// Handle the NiNode, and any children it might have
-	handleNiNode(n, node, flags);
-    }
-
-    {
-      NiTriShape n = cast(NiTriShape)data;
-      if(n !is null)
-	// Trishape, with a mesh
-	handleNiTriShape(n, node, flags);
-    }
-  }
-
-  void handleNiNode(NiNode data, NodePtr node, int flags)
-  {
-    // Ignore sound activators and similar objects.
-    NiStringExtraData d = cast(NiStringExtraData) data.extra;
-    if(d !is null)
-      {
-        // Marker objects are only visible in the editor. We
-        // completely ignore them.
-        if(d.string == "MRK")
-          return;
-
-        // No collision
-        if(d.string == "NCO")
-          flags |= 0x800; // Temporary internal marker
-      }
-
-    // Handle any effects here
-
-    // In the cases where meshes have skeletal animations, we must
-    // insert the children as bones in a skeleton instead, like we
-    // originally did for all nodes. Update: A much better way is to
-    // first insert the nodes normally, and then create the
-    // skeleton. The nodes can then be moved one by one over to the
-    // appropriate bones.
-
-    // Check the controller
-    auto cont = data.controller;
-    while(cont !is null)
-      {
-        auto kc = cast(NiKeyframeController)cont;
-        auto pc = cast(NiPathController)cont;
-        if(kc !is null)
-          {
-            /*
-            writefln("Found keyframe controller");
-            writefln("   Node name was: %s", data.name);
-            assert(cont.target is data);
-
-            auto kcd = kc.data;
-            writefln("   Types: %s %s %s",
-                     kcd.rotType, kcd.traType, kcd.scaleType);
-            */
-
-            /*
-              Adding keyframes:
-
-              Skeleton -> Animation -> NodeAnimationTrack nt;
-
-              TransformKeyFrame * tf = nt->createNodeKeyFrame(time);
-              tf->setTranslate(Vector3);
-              tf->setScale(Vector3);
-              tf->setRotation(Quaternion);
-
-              nt->applyToNode(node, time);
-              evt
-              Animation an;
-              an->apply(skeleton, time);
-             */
-          }
-        else if(pc !is null)
-          {
-            //writefln("Found path controller");
-            assert(cont.target is data);
-          }
-        //else writefln("Other controller (%s)", cont);
-        cont = cont.next;
-      }
-
-    // Loop through children
-    foreach(Node n; data.children)
-      insertNode(n, node, flags);
-  }
-
-  void handleNiTriShape(NiTriShape shape, NodePtr node, int flags)
-  {
-    char[] texture;
-    char[] material;
-    char[] newName = UniqueName(baseName);
-    NiMaterialProperty mp;
-
-    // Special alpha settings, if the NiAlphaProperty is present
-    int alphaFlags = -1;
-    ubyte alphaTest;
-
-    bool hidden = (flags & 0x01) != 0; // Not displayed
-    bool collide = (flags & 0x02) != 0; // Use this mesh for collision
-    bool bbcollide = (flags & 0x04) != 0; // Use bounding box for
-                                          // collision
-    // Always use mesh collision for now
-    if(bbcollide) collide = true;
-    bbcollide = false;
-
-    // Things marked "NCO" should not collide with anything.
-    if(flags & 0x800)
-      { collide = false; bbcollide=false; }
-
-    // Skip the entire material phase for hidden nodes
-    if(hidden) goto nomaterial;
-
-    // Scan the property list for textures
-    foreach(Property p; shape.properties)
-      {
-	// NiTexturingProperty block
-	{
-	  NiTexturingProperty t = cast(NiTexturingProperty) p;
-	  if(t !is null && t.textures[0].inUse)
-	    {
-	      // Ignore all other options for now
-	      NiSourceTexture st = t.textures[0].texture;
-	      if(st.external)
-		{
-		  // Find the resource for this texture
-		  TextureIndex ti = resources.lookupTexture(st.filename);
-		  // Insert a manual loader into OGRE
-		  // ti.load();
-
-		  // Get the resource name. We use getNewName to get
-		  // the real texture name, not the lookup
-		  // name. NewName has been converted to .dds if
-		  // necessary, to match the file name in the bsa
-		  // archives.
-		  texture = ti.getNewName();
-		}
-	      else
-		{
-		  // Internal textures
-		  texture = "BLAH";
-		  writefln("Internal texture, cannot read this yet.");
-		  writefln("Final resource name: '%s'", texture);
-		}
-	      continue;
-	    }
-	}
-
-        // NiAlphaProperty
-        {
-          NiAlphaProperty a = cast(NiAlphaProperty) p;
-          if(a !is null)
-            {
-              alphaFlags = a.flags;
-              alphaTest = a.threshold;
-            }
-        }
-
-	// NiMaterialProperty block
-	{
-	  NiMaterialProperty tmp = cast(NiMaterialProperty) p;
-	  if(tmp !is null)
-	    {
-	      if(mp !is null) writefln("WARNING: More than one material!");
-	      mp = tmp;
-	      material = newName;
-	      continue;
-	    }
-	}
-      }
-    // Get a pointer to the texture name
-    char* texturePtr;
-    if(texture.length) texturePtr = toStringz(texture);
-    else texturePtr = null;
-
-    // Create the material
-    if(material.length)
-      // A material is present. Use it.
-      ogre_createMaterial(material.ptr, mp.ambient.array.ptr,
-                          mp.diffuse.array.ptr,
-                          mp.specular.array.ptr, mp.emissive.array.ptr,
-                          mp.glossiness, mp.alpha, texturePtr,
-                          alphaFlags, alphaTest);
-    else if(texturePtr)
-      {
-	// Texture, but no material. Make a default one.
-	writefln("WARNING: Making default material for %s", texture);
-	float[3] zero;
-	float[3] one;
-	zero[] = 0.0;
-	one[] = 1.0;
-
-	ogre_createMaterial(newName.ptr, one.ptr, one.ptr, zero.ptr, zero.ptr,
-                            0.0, 1.0, texturePtr, alphaFlags, alphaTest);
-      }
-
-  nomaterial:
-
-    with(shape.data)
-      {
-	//writefln("Number of vertices: ", vertices.length);
-
-	float *normalsPtr;
-	float *colorsPtr;
-	float *uvsPtr;
-	short *facesPtr;
-
-	// Point pointers into the correct arrays, if they are present. If
-	// not, the pointers retain their values of null.
-	if(normals.length) normalsPtr = normals.ptr;
-	if(colors.length) colorsPtr = colors.ptr;
-	if(uvlist.length) uvsPtr = uvlist.ptr;
-	if(triangles.length) facesPtr = triangles.ptr;
-
-	float
-	  minX = float.infinity,
-	  minY = float.infinity,
-	  minZ = float.infinity,
-	  maxX = -float.infinity,
-	  maxY = -float.infinity,
-	  maxZ = -float.infinity;
-
-	// Calculate the bounding box. TODO: This is really a
-	// hack. IIRC the bounding box supplied by the NIF could not
-	// be trusted, but I can't remember why :/
-	for( int i; i < vertices.length; i+=3 )
-	  {
-	    if( vertices[i] < minX ) minX = vertices[i];
-	    if( vertices[i+1] < minY ) minY = vertices[i+1];
-	    if( vertices[i+2] < minZ) minZ = vertices[i+2];
-
-	    if( vertices[i] > maxX) maxX = vertices[i];
-	    if( vertices[i+1] > maxY) maxY = vertices[i+1];
-	    if( vertices[i+2] > maxZ) maxZ = vertices[i+2];
-	  }
-
-        // Get the node world transformation, needed to set up
-        // the collision shape properly.
-        float[3] trans;
-        float[9] matrix;
-        ogre_getWorldTransform(node, trans.ptr, matrix.ptr);
-
-        // Next we must create the actual OGRE mesh and the collision
-        // objects, based on the flags we have been given. TODO: I
-        // guess the NIF bounding box is better than the one we have
-        // calculated ourselves? This code definitely doesn't work,
-        // but I haven't look into why yet.
-        assert(!bbcollide);
-        if(bbcollide)
-          // Insert the bounding box into the collision system
-          bullet_createBoxShape(minX, minY, minZ, maxX, maxY, maxZ,
-                                trans.ptr, matrix.ptr);
-
-        // Create a bullet collision shape from the trimesh. Pass
-        // along the world transformation as well, since we must
-        // transform the trimesh data manually.
-        else if(collide)
-          {
-            assert(facesPtr !is null,
-                   "cannot create collision shape without a mesh");
-            bullet_createTriShape(triangles.length, facesPtr,
-                                  vertices.length, vertices.ptr,
-                                  trans.ptr, matrix.ptr);
-          }
-
-        // Create the ogre mesh, associate it with the node. Skip for
-        // hidden nodes.
-        if(!hidden)
-          ogre_createMesh(newName.ptr, vertices.length, vertices.ptr,
-                          normalsPtr, colorsPtr, uvsPtr, triangles.length,
-                          facesPtr, radius, material.ptr, minX, minY, minZ,
-                          maxX, maxY, maxZ, node);
-      }
-  }
-}
diff --git a/old_d_version/openmw.d b/old_d_version/openmw.d
deleted file mode 100644
index 095e8cdd82..0000000000
--- a/old_d_version/openmw.d
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008-2009  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (openmw.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module openmw;
-
-import std.stdio;
-import std.string;
-import std.cstream;
-import std.file;
-
-import ogre.ogre;
-import ogre.bindings;
-import gui.bindings;
-import gui.gui;
-
-import bullet.bullet;
-
-import scene.celldata;
-import scene.soundlist;
-import scene.gamesettings;
-import scene.player;
-
-import core.resource;
-import core.memory;
-import core.config;
-
-import monster.util.string;
-import monster.vm.mclass;
-import monster.vm.dbg;
-import mscripts.setup;
-
-import sound.audio;
-
-import input.events;
-
-import terrain.terrain;
-
-// Set up exit handler
-alias void function() c_func;
-extern(C) int atexit(c_func);
-
-bool cleanExit = false;
-
-void exitHandler()
-{
-  // If we exit uncleanly, print the function stack.
-  if(!cleanExit)
-    writefln(dbg.getTrace());
-}
-
-
-//*
-import std.gc;
-import gcstats;
-
-void poolSize()
-{
-  GCStats gc;
-  getStats(gc);
-  writefln("Pool size: ", comma(gc.poolsize));
-  writefln("Used size: ", comma(gc.usedsize));
-}
-//*/
-
-void main(char[][] args)
-{
-  bool render = true;
-  bool help = false;
-  bool resetKeys = false;
-  bool showOgreFlag = false;
-  bool debugOut = false;
-  bool extTest = false;
-  bool doGen = false;
-  bool nextSave = false;
-  bool loadSave = false;
-
-  // Some examples to try:
-  //
-  // "Abandoned Shipwreck, Upper Level";
-  // "Gro-Bagrat Plantation";
-  // "Abinabi";
-  // "Abebaal Egg Mine";
-  // "Ald-ruhn, Ald Skar Inn";
-  // "Koal Cave";
-  // "Ald-ruhn, Arobar Manor Bedrooms"
-  // "Sud";
-  // "Vivec, The Lizard's Head";
-  // "ToddTest";
-
-  // Cells to load
-  char[][] cells;
-
-  // Savegame to load
-  char[] savefile;
-
-  foreach(char[] a; args[1..$])
-    if(a == "-n") render = false;
-    else if(a == "-ex") extTest = true;
-    else if(a == "-gen") doGen = true;
-    else if(a == "-h") help=true;
-    else if(a == "-rk") resetKeys = true;
-    else if(a == "-oc") showOgreFlag = true;
-    else if(a == "-ns") config.noSound = true;
-    else if(a == "-save") nextSave = true;
-    else if(a == "-debug")
-      {
-        // Enable Monster debug output
-        dbg.dbgOut = dout;
-
-        // Tell OGRE to do the same later on
-        debugOut = true;
-      }
-    else if(nextSave)
-      {
-        savefile = a;
-        nextSave = false;
-      }
-    else cells ~= a;
-
-  if(cells.length > 1)
-    {
-      writefln("More than one cell specified, rendering disabled");
-      render=false;
-    }
-
-  void showHelp()
-    {
-      writefln("Syntax: %s [options] cell-name [cell-name]", args[0]);
-      writefln("  Options:");
-      writefln("    -n            Only load, do not render");
-      writefln("    -ex           Test the terrain system");
-      writefln("    -gen          Generate landscape cache");
-      writefln("    -rk           Reset key bindings to default");
-      writefln("    -oc           Show the Ogre config dialogue");
-      writefln("    -ns           Completely disable sound");
-      writefln("    -debug        Print debug information");
-      writefln("    -save <file>  Load cell/pos from savegame");
-      writefln("    -h            Show this help");
-      writefln("");
-      writefln("Specifying more than one cell implies -n");
-    }
-
-  if(help)
-    {
-      showHelp();
-      return;
-    }
-
-  initializeMemoryRegions();
-  initMonsterScripts();
-
-  // This is getting increasingly hackish, but this entire engine
-  // design is now quickly outgrowing its usefulness, and a rewrite is
-  // coming soon anyway.
-  PlayerSaveInfo pi;
-  if(savefile != "")
-    {
-      if(cells.length)
-        {
-          writefln("Please don't specify both a savegame file (%s) and cell names (%s)", savefile, cells);
-          return;
-        }
-
-      loadSave = true;
-      writefln("Loading savegame %s", savefile);
-      pi = importSavegame(savefile);
-      writefln("    Player name: %s", pi.playerName);
-      writefln("    Cell name:   %s", pi.cellName);
-      writefln("    Pos:         %s", pi.pos.position);
-      writefln("    Rot:         %s", pi.pos.rotation);
-
-      cells = [pi.cellName];
-    }
-
-  config.initialize(resetKeys);
-  scope(exit) config.writeConfig();
-
-  // Check if the data directory exists
-  if(!exists(config.dataDir) || !isdir(config.dataDir))
-  {
-    writefln("Cannot find data directory '", config.dataDir,
-	"' - please edit openmw.ini.");
-    return;
-  }
-
-  // If the -oc parameter is specified, we override any config
-  // setting.
-  if(showOgreFlag) config.finalOgreConfig = true;
-
-  if(cells.length == 0)
-    if(config.defaultCell.length)
-      cells ~= config.defaultCell;
-
-  if(cells.length == 1 && !loadSave)
-    config.defaultCell = cells[0];
-
-  if(cells.length == 0)
-    {
-      showHelp();
-      return;
-    }
-
-  if(!config.noSound) initializeSound();
-  resources.initResources();
-
-  // Load all ESM and ESP files
-  loadTESFiles(config.gameFiles);
-
-  scene.gamesettings.loadGameSettings();
-
-  CellData cd = cellList.get();
-
-  foreach(char[] cName; cells)
-    {
-      // Release the last cell data
-      cellList.release(cd);
-
-      // Get a cell data holder and load an interior cell
-      cd = cellList.get();
-
-      try cd.loadIntCell(cName);
-      catch(Exception e)
-	{
-	  writefln("\nUnable to load cell '%s'.", cName);
-	  writefln("\nDetails: %s", e);
-          writefln("
-Perhaps this cell does not exist in your Morrowind language version?
-Try specifying another cell name on the command line, or edit openmw.ini.");
-	  return;
-	}
-
-      // If we're loading from save, override the player position
-      if(loadSave)
-        *playerData.position = pi.pos;
-    }
-
-  // Simple safety hack
-  NodePtr putObject(MeshIndex m, Placement *pos, float scale,
-                    bool collide=false)
-    {
-      if(m is null)
-	writefln("WARNING: CANNOT PUT NULL OBJECT");
-      else if(!m.isEmpty)
-        return placeObject(m, pos, scale, collide);
-
-      //writefln("WARNING: CANNOT INSERT EMPTY MESH '%s'", m.getName);
-      return null;
-    }
-
-  if(cd.inCell !is null)
-    // Set the name for the GUI (temporary hack)
-    gui_setCellName(cd.inCell.id.ptr);
-
-  // Set up the exit handler
-  atexit(&exitHandler);
-  scope(exit) cleanExit = true;
-
-  if(render)
-    {
-      // Warm up OGRE
-      setupOgre(debugOut);
-      scope(exit) cleanupOgre();
-
-      // Create the GUI system
-      initGUI(debugOut);
-
-      // Set up Bullet
-      initBullet();
-      scope(exit) cleanupBullet();
-
-      // Initialize the internal input and event manager. The
-      // lower-level input system (OIS) is initialized by the
-      // setupOgre() call further up.
-      initializeInput();
-
-      // Play some old tunes
-      if(extTest)
-        {
-          // Exterior cell
-          /*
-	  Color c;
-	  c.red = 180;
-	  c.green = 180;
-	  c.blue = 180;
-	  setAmbient(c, c, c, 0);
-
-	  // Put in the water
-	  ogre_createWater(cd.water);
-
-	  // Create an ugly sky
-	  ogre_makeSky();
-          */
-
-          initTerrain(doGen);
-        }
-      else
-        {
-          // Interior cell
-          assert(cd.inCell !is null);
-	  setAmbient(cd.ambi.ambient, cd.ambi.sunlight,
-		     cd.ambi.fog, cd.ambi.fogDensity);
-
-	  // Not all interior cells have water
-	  if(cd.inCell.flags & CellFlags.HasWater)
-	    ogre_createWater(cd.water);
-
-          // Insert the meshes of statics into the scene
-          foreach(ref LiveStatic ls; cd.statics)
-            putObject(ls.m.model, ls.getPos(), ls.getScale(), true);
-          // Inventory lights
-          foreach(ref LiveLight ls; cd.lights)
-            {
-              NodePtr n = putObject(ls.m.model, ls.getPos(), ls.getScale());
-              ls.lightNode = attachLight(n, ls.m.data.color, ls.m.data.radius);
-              if(!config.noSound)
-                {
-                  Sound *s = ls.m.sound;
-                  if(s)
-                    {
-                      ls.loopSound = soundScene.insert(s, true);
-                      if(ls.loopSound)
-                        {
-                          auto p = ls.getPos();
-                          ls.loopSound.setPos(p.position[0],
-                                              p.position[1],
-                                              p.position[2]);
-                        }
-                    }
-                }
-            }
-          // Static lights
-          foreach(ref LiveLight ls; cd.statLights)
-            {
-              NodePtr n = putObject(ls.m.model, ls.getPos(), ls.getScale(), true);
-              ls.lightNode = attachLight(n, ls.m.data.color, ls.m.data.radius);
-              if(!config.noSound)
-                {
-                  Sound *s = ls.m.sound;
-                  if(s)
-                    {
-                      ls.loopSound = soundScene.insert(s, true);
-                      if(ls.loopSound)
-                        {
-                          auto p = ls.getPos();
-                          ls.loopSound.setPos(p.position[0],
-                                              p.position[1],
-                                              p.position[2]);
-                        }
-                    }
-                }
-            }
-          // Misc items
-          foreach(ref LiveMisc ls; cd.miscItems)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-          /*
-          // NPCs (these are complicated, usually do not have normal meshes)
-          foreach(ref LiveNPC ls; cd.npcs)
-          putObject(ls.m.model, ls.getPos(), ls.getScale());
-          */
-          // Containers
-          foreach(ref LiveContainer ls; cd.containers)
-            putObject(ls.m.model, ls.getPos(), ls.getScale(), true);
-          // Doors
-          foreach(ref LiveDoor ls; cd.doors)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-          // Activators (including beds etc)
-          foreach(ref LiveActivator ls; cd.activators)
-            putObject(ls.m.model, ls.getPos(), ls.getScale(), true);
-          // Potions
-          foreach(ref LivePotion ls; cd.potions)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-          // Apparatus
-          foreach(ref LiveApparatus ls; cd.appas)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-          // Ingredients
-          foreach(ref LiveIngredient ls; cd.ingredients)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-          // Armors
-          foreach(ref LiveArmor ls; cd.armors)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-          // Weapons
-          foreach(ref LiveWeapon ls; cd.weapons)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-          // Books
-          foreach(ref LiveBook ls; cd.books)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-          // Clothes
-          foreach(ref LiveClothing ls; cd.clothes)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-          // Tools
-          foreach(ref LiveTool ls; cd.tools)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-          // Creatures (not displayed very well yet)
-          foreach(ref LiveCreature ls; cd.creatures)
-            putObject(ls.m.model, ls.getPos(), ls.getScale());
-
-          // End of interior cell
-        }
-
-      // Run GUI system
-      startGUI();
-
-      // Play some old tunes
-      if(!config.noSound)
-        Music.play();
-
-      // Run it until the user tells us to quit
-      startRendering();
-    }
-  else if(debugOut) writefln("Skipping rendering");
-
-  if(!config.noSound)
-    {
-      soundScene.kill();
-      shutdownSound();
-    }
-
-  if(debugOut)
-    {
-      writefln();
-      writefln("%d statics", cd.statics.length);
-      writefln("%d misc items", cd.miscItems.length);
-      writefln("%d inventory lights", cd.lights.length);
-      writefln("%d static lights", cd.statLights.length);
-      writefln("%d NPCs", cd.npcs.length);
-      writefln("%d containers", cd.containers.length);
-      writefln("%d doors", cd.doors.length);
-      writefln("%d activators", cd.activators.length);
-      writefln("%d potions", cd.potions.length);
-      writefln("%d apparatuses", cd.appas.length);
-      writefln("%d ingredients", cd.ingredients.length);
-      writefln("%d armors", cd.armors.length);
-      writefln("%d weapons", cd.weapons.length);
-      writefln("%d books", cd.books.length);
-      writefln("%d tools", cd.tools.length);
-      writefln("%d clothes", cd.clothes.length);
-      writefln("%d creatures", cd.creatures.length);
-      writefln();
-    }
-
-  // This isn't necessary but it's here for testing purposes.
-  cellList.release(cd);
-
-  // Write some statistics
-  if(debugOut)
-    {
-      poolSize();
-      writefln(esmRegion);
-      writefln("Total objects: ", MonsterClass.getTotalObjects);
-    }
-}
diff --git a/old_d_version/terrain/archive.d b/old_d_version/terrain/archive.d
deleted file mode 100644
index 5f5d5fd80f..0000000000
--- a/old_d_version/terrain/archive.d
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2009  Nicolay Korslund
-  WWW: http://openmw.sourceforge.net/
-
-  This file (archive.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
-*/
-
-module terrain.archive;
-
-const float TEX_SCALE = 1.0/16;
-
-// This should be part of the generic cache system.
-const int CACHE_MAGIC = 0x345AF815;
-
-import std.mmfile;
-import std.string;
-import std.stdio;
-import terrain.myfile;
-
-version(Windows)
-  static int pageSize = 64*1024;
-else
-  static int pageSize = 4*1024;
-
-extern(C)
-{
-  // Convert a texture index to string
-  char *d_terr_getTexName(int index)
-    { return g_archive.getString(index).ptr; }
-
-  // Fill various hardware buffers from cache
-  void d_terr_fillVertexBuffer(MeshInfo *mi, float *buffer, ulong size)
-    { mi.fillVertexBuffer(buffer[0..size]); }
-
-  void d_terr_fillIndexBuffer(MeshInfo *mi, ushort *buffer, ulong size)
-    { mi.fillIndexBuffer(buffer[0..size]); }
-
-  void d_terr_fillAlphaBuffer(AlphaInfo *mi, ubyte *buffer, ulong size)
-    { mi.fillAlphaBuffer(buffer[0..size]); }
-
-  // Get a given alpha map struct belonging to a mesh
-  AlphaInfo *d_terr_getAlphaInfo(MeshInfo *mi, int index)
-    { return mi.getAlphaInfo(index); }
-
-  int d_terr_getAlphaSize() { return g_archive.alphaSize; }
-}
-
-// Info about the entire quad. TODO: Some of this (such as the texture
-// scale and probably the width and radius) can be generated at
-// loadtime and is common for all quads on the same level. We could
-// just make a QuadLevelInfo struct.
-struct QuadInfo
-{
-  // Basic info
-  int cellX, cellY;
-  int level;
-
-  // Bounding box info
-  float minHeight, maxHeight;
-  float worldWidth;
-  float boundingRadius;
-
-  // True if we should make the given child
-  bool hasChild[4];
-
-  // Number of mesh segments in this quad
-  int meshNum;
-
-  // Location of this quad in the main archive file. The size includes
-  // everything related to this quad, including mesh data, alpha maps,
-  // etc.
-  size_t offset, size;
-}
-
-// Info about an alpha map belonging to a mesh
-struct AlphaInfo
-{
-  // Position of the actual image data
-  ulong bufSize, bufOffset;
-
-  // The texture name for this layer. The actual string is stored in
-  // the archive's string buffer.
-  int texName = -1;
-  int alphaName = -1;
-
-  // Fill the alpha texture buffer
-  void fillAlphaBuffer(ubyte abuf[])
-  {
-    assert(abuf.length == bufSize);
-    g_archive.copy(abuf.ptr, bufOffset, bufSize);
-  }
-}
-static assert(AlphaInfo.sizeof == 6*4);
-
-// Info about each submesh
-// If you change this struct please check whether align(1) still fits.
-align(1)
-struct MeshInfo
-{
-  // Bounding box info
-  float minHeight, maxHeight;
-  float worldWidth;
-
-  // Vertex and index numbers
-  int vertRows, vertCols;
-
-  // Height offset to apply to all vertices
-  float heightOffset;
-
-  // Size and offset of the vertex buffer
-  ulong vertBufSize, vertBufOffset;
-
-  // Texture name. Index to the string table.
-  int texName = -1;
-
-  // Number and offset of AlphaInfo blocks
-  int alphaNum;
-  ulong alphaOffset;
-
-  // Fill the given vertex buffer
-  void fillVertexBuffer(float vdest[])
-  {
-    // The height map and normals from the archive
-    byte *hmap = cast(byte*)g_archive.getRelSlice(vertBufOffset, vertBufSize).ptr;
-    // The generic part, containing the x,y coordinates and the uv
-    // maps.
-    float *gmap = g_archive.getVertexBuffer(getLevel()).ptr;
-
-    // Destination pointer
-    float *vbuf = vdest.ptr;
-    assert(vdest.length == vertRows*vertCols*8);
-
-    // Merge the two data sets together into the output buffer.
-    float offset = heightOffset;
-    for(int y=0; y<vertRows; y++)
-      {
-        // The offset for the entire row is determined by the first
-        // height value. All the values in a row gives the height
-        // relative to the previous value, and the first value in each
-        // row is relative to the first value in the previous row.
-        offset += *cast(short*)hmap;
-
-        // This is the 'sliding offset' for this row. It's adjusted
-        // for each vertex that's added, but only affects this row.
-        float rowofs = offset;
-        for(int x=0; x<vertCols; x++)
-          {
-            hmap+=2; // Skip the height we just read
-
-            // X and Y from the pregenerated buffer
-            *vbuf++ = *gmap++;
-            *vbuf++ = *gmap++;
-
-            // The height is calculated from the current offset
-            *vbuf++ = rowofs * 8;
-
-            // Normal vector.
-            *vbuf++ = *hmap++;
-            *vbuf++ = *hmap++;
-            *vbuf++ = *hmap++;
-
-            // UV
-            *vbuf++ = *gmap++;
-            *vbuf++ = *gmap++;
-
-            // Adjust the offset for the next vertex.
-            if(x < vertCols-1)
-              rowofs += *cast(short*)hmap;
-          }
-      }
-  }
-
-  // Fill the index buffer
-  void fillIndexBuffer(ushort ibuf[])
-  {
-    // The index buffer is pregenerated. It is identical for all
-    // meshes on the same level, so just copy it over.
-    ushort generic[] = g_archive.getIndexBuffer();
-    assert(ibuf.length == generic.length);
-    ibuf[] = generic[];
-  }
-
-  int getLevel()
-  {
-    assert(g_archive.curQuad);
-    return g_archive.curQuad.level;
-  }
-
-  // Get an alpha map belonging to this mesh
-  AlphaInfo *getAlphaInfo(int num)
-  {
-    assert(num < alphaNum && num >= 0);
-    assert(getLevel() == 1);
-    AlphaInfo *res = cast(AlphaInfo*)g_archive.getRelSlice
-      (alphaOffset, alphaNum*AlphaInfo.sizeof);
-    res += num;
-    return res;
-  }
-}
-static assert(MeshInfo.sizeof == 14*4);
-
-// The first part of the .index file
-struct ArchiveHeader
-{
-  // "Magic" number to make sure we're actually reading an archive
-  // file
-  int magic;
-
-  // Total number of quads in the archive
-  int quads;
-
-  // Level of the 'root' quad. There will only be one quad on this
-  // level.
-  int rootLevel;
-
-  // Size of the alpha maps, in pixels along one side.
-  int alphaSize;
-
-  // Number of strings in the string table
-  int stringNum;
-
-  // Size of the string buffer
-  size_t stringSize;
-}
-
-TerrainArchive g_archive;
-
-// This class handles the cached terrain data.
-struct TerrainArchive
-{
-  MeshInfo *curMesh;
-  QuadInfo *curQuad;
-  QuadInfo *rootQuad;
-
-  void openFile(char[] name)
-  {
-    mmf = new MmFile(name,
-                     MmFile.Mode.Read,
-                     0, null, pageSize);
-
-    // Read the index file first
-    MyFile ifile = new MyFile(name ~ ".index");
-
-    ArchiveHeader head;
-    ifile.fill(head);
-
-    // Reads data into an array. Would be better if this was part of
-    // the stream.
-
-    // Sanity check
-    assert(head.magic == CACHE_MAGIC);
-    assert(head.quads > 0 && head.quads < 8192);
-
-    // Store header info
-    alphaSize = head.alphaSize;
-
-    // Read all the quads
-    quadList = new QuadInfo[head.quads];
-    ifile.fillArray(quadList);
-
-    // Create an index of all the quads
-    foreach(int index, qn; quadList)
-      {
-        int x = qn.cellX;
-        int y = qn.cellY;
-        int l = qn.level;
-
-        assert(l >= 1);
-
-        quadMap[l][x][y] = index;
-        assert(index == quadMap[l][x][y]);
-
-        // Store the root quad
-        if(l == head.rootLevel)
-          {
-            assert(rootQuad == null);
-            rootQuad = &quadList[index];
-          }
-        else
-          assert(l < head.rootLevel);
-      }
-
-    // Make sure the root was set
-    assert(rootQuad !is null);
-
-    // Next read the string table. First read the main string buffer.
-    stringBuf = new char[head.stringSize];
-    ifile.fillArray(stringBuf);
-
-    // Then read the string offsets
-    int[] offsets = new int[head.stringNum];
-    ifile.fillArray(offsets);
-
-    // Set up the string table
-    char *strptr = stringBuf.ptr;
-    strings.length = head.stringNum;
-    foreach(int i, ref str; strings)
-      {
-        // toString(char*) returns the string up to the zero
-        // terminator byte
-        str = toString(strptr + offsets[i]);
-        assert(str.ptr + str.length <=
-               stringBuf.ptr + stringBuf.length);
-      }
-    delete offsets;
-
-    // Read the vertex buffer data
-    int bufNum = head.rootLevel;
-    assert(bufNum == 7);
-    vertBufData.length = bufNum;
-
-    // Fill the vertex buffers. Start at level 1.
-    for(int i=1;i<bufNum;i++)
-      {
-        // Vertex buffer
-        ifile.readArray(vertBufData[i]);
-      }
-
-    // Index buffer
-    ifile.readArray(indexBufData);
-  }
-
-  bool hasQuad(int X, int Y, int level)
-  {
-    if((level in quadMap) is null ||
-       (X in quadMap[level]) is null ||
-       (Y in quadMap[level][X]) is null)
-      return false;
-    return true;
-  }
-
-  // Get info about a given quad from the index.
-  QuadInfo *getQuad(int X, int Y, int level)
-  {
-    assert(hasQuad(X,Y,level), format("Cannot find quad %s %s level %s",
-                                      X, Y, level));
-    int ind = quadMap[level][X][Y];
-    QuadInfo *res = &quadList[ind];
-    assert(res);
-    return res;
-  }
-
-  // Maps the terrain and material info for a given quad into
-  // memory. This is typically called right before the meshes are
-  // created.
-  void mapQuad(QuadInfo *info)
-  {
-    assert(info);
-
-    // Store the quad for later
-    curQuad = info;
-
-    doMap(info.offset, info.size);
-  }
-
-  // Get the info struct for a given segment. Remembers the MeshInfo
-  // for all later calls.
-  MeshInfo *getMeshInfo(int segNum)
-    {
-      assert(curQuad);
-      assert(segNum < curQuad.meshNum);
-
-      // The mesh headers are at the beginning of the mapped segment.
-      curMesh = cast(MeshInfo*) getRelSlice(0, MeshInfo.sizeof*curQuad.meshNum);
-      curMesh += segNum;
-
-      return curMesh;
-    }
-
-  float[] getVertexBuffer(int level)
-  {
-    assert(level>=1 && level<vertBufData.length);
-    return vertBufData[level];
-  }
-
-  ushort[] getIndexBuffer()
-  {
-    return indexBufData;
-  }
-
-private:
-  // All quad headers (from the index) are stored in this array
-  QuadInfo quadList[];
-
-  // A map of all quads. Contain indices to the above array. Indexed
-  // by [level][X][Y].
-  int[int][int][int] quadMap;
-
-  // These contain pregenerated mesh data that is common for all
-  // meshes on a given level.
-  float[][] vertBufData;
-  ushort[] indexBufData;
-
-  // Used for the mmapped file
-  MmFile mmf;
-
-  ubyte mapped[];
-
-  // Stores the string table
-  char[] stringBuf;
-  char[][] strings;
-
-  // Texture size of the alpha maps.
-  int alphaSize;
-
-  char[] getString(int index)
-  {
-    assert(index >= 0);
-    assert(index < strings.length);
-
-    return strings[index];
-  }
-
-  void doMap(size_t offset, size_t size)
-  {
-    assert(mmf !is null);
-    assert(size);
-    mapped = cast(ubyte[])mmf[offset..offset+size];
-    assert(mapped.length == size);
-  }
-
-  // Get a slice of a given buffer within the mapped window. The
-  // offset is relative to the start of the window, and the size must
-  // fit inside the window.
-  ubyte[] getRelSlice(size_t offset, size_t size)
-  {
-    assert(mapped.length);
-
-    return mapped[offset..offset+size];
-  }
-
-  // Copy a given buffer from the file. The buffer might be a
-  // compressed stream, so it's important that the buffers are written
-  // in the same block sizes as they are read. (Ie. you can't write a
-  // buffer as one operation and read it as two, or vice versa. Also,
-  // buffers cannot overlap.) The offset is relative to the current
-  // mapped file window.
-  void copy(void *dst, size_t offset, size_t inSize)
-  {
-    ubyte source[] = getRelSlice(offset, inSize);
-
-    // Just copy it for now
-    ubyte* dest = cast(ubyte*)dst;
-    dest[0..source.length] = source[];
-  }
-}
diff --git a/old_d_version/terrain/bindings.d b/old_d_version/terrain/bindings.d
deleted file mode 100644
index 145d1a5934..0000000000
--- a/old_d_version/terrain/bindings.d
+++ /dev/null
@@ -1,27 +0,0 @@
-module terrain.bindings;
-
-alias void *SceneNode;
-alias void *Bounds;
-alias void *MeshObj;
-
-// These are all defined in cpp_terrain.cpp:
-extern(C):
-
-SceneNode terr_createChildNode(float relX, float relY, SceneNode);
-void terr_destroyNode(SceneNode);
-Bounds terr_makeBounds(float minHeight, float maxHeight, float width, SceneNode);
-void terr_killBounds(Bounds);
-float terr_getSqCamDist(Bounds);
-MeshObj terr_makeMesh(SceneNode,void*,int,float);
-void terr_killMesh(MeshObj);
-
-void terr_genData();
-void terr_setupRendering();
-
-void terr_makeLandMaterial(char*,float);
-ubyte *terr_makeAlphaLayer(char*,int);
-void terr_closeAlpha(char*,char*,float);
-void terr_cleanupAlpha(char*,void*,int);
-
-void terr_resize(void*,void*,int,int);
-void terr_saveImage(void*,int,char*);
diff --git a/old_d_version/terrain/cachewriter.d b/old_d_version/terrain/cachewriter.d
deleted file mode 100644
index 61a52addb1..0000000000
--- a/old_d_version/terrain/cachewriter.d
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2009  Nicolay Korslund
-  WWW: http://openmw.sourceforge.net/
-
-  This file (cachewriter.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
-*/
-
-module terrain.cachewriter;
-
-import terrain.archive;
-
-import terrain.outbuffer;
-import std.stdio, std.stream, std.string;
-import terrain.myfile;
-import std.math2;
-import monster.util.string;
-import monster.vm.dbg;
-
-// Helper structs
-struct AlphaHolder
-{
-  AlphaInfo info;
-
-  // Actual pixel buffer
-  ubyte[] buffer;
-}
-
-struct MeshHolder
-{
-  MeshInfo info;
-
-  // Actual buffers
-  byte[] vertexBuffer;
-
-  // Alpha maps (if any)
-  AlphaHolder alphas[];
-}
-
-// A struct that gathers all the relevant quad data in one place.
-struct QuadHolder
-{
-  QuadInfo info;
-
-  MeshHolder meshes[];
-}
-
-struct CacheWriter
-{
-  // Opens the main archive file for output
-  void openFile(char[] fname)
-  {
-    mainFile = new File(fname, FileMode.OutNew);
-    iname = fname ~ ".index";
-
-    buf = new OutBuffer;
-  }
-
-  void setParams(int mxLev, int alphSize)
-  {
-    maxLevel = mxLev;
-    alphaSize = alphSize;
-
-    vertBuf.length = maxLevel;
-  }
-
-  // Closes the main archive file and writes the index.
-  void finish()
-  {
-    mainFile.close();
-
-    // Write the index file
-    scope MyFile ofile = new MyFile(iname, FileMode.OutNew);
-
-    // Header first
-    ArchiveHeader head;
-    head.magic = CACHE_MAGIC;
-    head.quads = quadList.length;
-    head.rootLevel = maxLevel;
-    head.alphaSize = alphaSize;
-    head.stringNum = stringList.length;
-    head.stringSize = totalStringLength;
-    ofile.dump(head);
-
-    // Write the quads
-    ofile.dumpArray(quadList);
-
-    // String table next. We need to sort it in order of the indices
-    // first.
-    char[][] strVector;
-    strVector.length = head.stringNum;
-
-    foreach(char[] key, int value; stringList)
-      strVector[value] = key;
-
-    // Next, write the strings to file while we fill in the offset
-    // list
-    int[] offsets = new int[head.stringNum];
-
-    size_t curOffs = 0;
-    for(int i=0; i<head.stringNum; i++)
-      {
-        // Add one byte for the zero terminator
-        int len = strVector[i].length + 1;
-        char *ptr = strVector[i].ptr;
-
-        if(ptr[len-1] != 0)
-          ptr = toStringz(strVector[i]);
-
-        assert(ptr[len-1] == 0);
-
-        ofile.writeExact(ptr, len);
-
-        // Store the offset
-        offsets[i] = curOffs;
-        curOffs += len;
-      }
-    // At the end the offset should match the buffer size we set in
-    // the header.
-    assert(curOffs == head.stringSize);
-
-    // Finally, write the offset table itself
-    ofile.dumpArray(offsets);
-
-    // Write the common vertex and index buffers
-    assert(maxLevel == 7);
-    for(int i=1;i<maxLevel;i++)
-      {
-        // Write vertex buffer
-        ofile.writeArray(vertBuf[i]);
-        delete vertBuf[i];
-      }
-
-    // Then the index buffer
-    ofile.writeArray(indexBuf);
-
-    // Don't need these anymore
-    delete offsets;
-    delete strVector;
-    delete quadList;
-    delete vertBuf;
-    delete indexBuf;
-    delete buf;
-    delete mainFile;
-  }
-
-  // Add a common vertex buffer for a given level
-  void addVertexBuffer(int level, float[] buf)
-  {
-    assert(vertBuf.length > level);
-    vertBuf[level] = buf;
-  }
-
-  // Add a common index buffer
-  void setIndexBuffer(ushort[] buf)
-  {
-    indexBuf = buf;
-  }
-
-  // Write a finished quad to the archive file. All the offsets and
-  // numbers in the *Info structs are filled in automatically based on
-  // the additional data in the Holder structs.
-  void writeQuad(ref QuadHolder qh)
-  {
-    scope auto _trc = new MTrace("writeQuad");
-
-    // Write the MeshInfo's first
-    int meshNum = qh.meshes.length;
-
-    MeshInfo meshes[] = buf.write!(MeshInfo)(meshNum);
-
-    float minh = float.infinity;
-    float maxh = -float.infinity;
-
-    // Then write the mesh data in approximately the order it's read
-    for(int i=0; i<meshNum; i++)
-      {
-        assert(meshes !is null);
-
-        auto mh = &qh.meshes[i];
-
-        // Copy the basic data first
-        meshes[i] = mh.info;
-
-        minh = min(minh,mh.info.minHeight);
-        maxh = max(maxh,mh.info.maxHeight);
-
-        // Set everything else except the offsets
-        int alphaNum = mh.alphas.length;
-        meshes[i].alphaNum = alphaNum;
-
-        // Write the vertex buffer
-        meshes[i].vertBufOffset = buf.size;
-        meshes[i].vertBufSize = mh.vertexBuffer.length;
-        writeBuf(mh.vertexBuffer);
-        assert(buf.size == meshes[i].vertBufOffset + meshes[i].vertBufSize);
-
-        // Next write the alpha maps, if any
-        meshes[i].alphaOffset = buf.size;
-        AlphaInfo ais[] = buf.write!(AlphaInfo)(alphaNum);
-
-        // Loop through the alpha maps
-        foreach(int k, ref ai; ais)
-          {
-            AlphaHolder ah = mh.alphas[k];
-            ai = ah.info;
-
-            // Write the alpha pixel buffer
-            ai.bufOffset = buf.size;
-            ai.bufSize = ah.buffer.length;
-            writeBuf(ah.buffer);
-          }
-      }
-    // Finally set up the QuadInfo itself
-    QuadInfo qi;
-
-    // Copy basic info
-    qi = qh.info;
-
-    // Derived info
-    qi.meshNum = meshNum;
-    qi.offset = fileOffset;
-    qi.size = buf.size;
-    qi.minHeight = minh;
-    qi.maxHeight = maxh;
-
-    // Get the side length, or the height difference if that is bigger
-    qi.boundingRadius = max(maxh-minh,qi.worldWidth);
-
-    // Multiply with roughly sqrt(1/2), converts from side length to
-    // radius with some extra slack
-    qi.boundingRadius *= 0.8;
-
-    // The quad cache is done, write it to file
-    buf.writeTo(mainFile);
-
-    // Update the main offset
-    fileOffset += qi.size;
-
-    // Add the quad to the list. This list isn't written to the main
-    // cache file, but to the index file.
-    quadList ~= qi;
-  }
-
-  // Add a texture name as a string. Will convert .tga file names to
-  // .dds as a convenience. TODO: Use the resource system to do this,
-  // it automatically searches for the dds variant.
-  int addTexture(char[] orig)
-  {
-    if(orig.iEnds(".tga"))
-      orig = orig[0..$-3] ~ "dds";
-    return addString(orig);
-  }
-
-  // Convert a string to an index
-  int addString(char[] str)
-  {
-    // Do we already have the string?
-    if(str in stringList)
-      return stringList[str];
-
-    // Nope, insert it
-    int index = stringList.length;
-    stringList[str] = index;
-    stringLookup[index] = str;
-
-    // Sum up the string lengths + 1 byte for the zero
-    totalStringLength += str.length + 1;
-    return index;
-  }
-
-  char[] getString(int index)
-  {
-    char[] res = stringLookup[index];
-    assert(stringList[res] == index);
-    return res;
-  }
-
-private:
-  // Write the given block of memory to 'buf', possibly compressing
-  // the data.
-  void writeBuf(void[] ptr)
-  {
-    ulong size = ptr.length;
-
-    // Reserve the maximum bytes needed.
-    void toPtr[] = buf.reserve(size);
-
-    // Store the data
-    toPtr[] = ptr[];
-
-    // Add the result buffer
-    buf.add(toPtr[0..size]);
-  }
-
-  // Used for 'writing' to a changable memory buffer before writing to
-  // file
-  OutBuffer buf;
-
-  // Common vertex and index buffers for all quads. One buffer per
-  // level.
-  float[][] vertBuf;
-  ushort[] indexBuf;
-
-  // Variables that must be set during the gen phase
-  int maxLevel;
-  int alphaSize;
-
-  // Contains a unique index for each string
-  int[char[]] stringList;
-  char[][int] stringLookup;
-  size_t totalStringLength;
-
-  // List of all quads
-  QuadInfo[] quadList;
-
-  // Output file
-  File mainFile;
-  size_t fileOffset;
-
-  // Index file name
-  char[] iname;
-}
diff --git a/old_d_version/terrain/cpp_baseland.cpp b/old_d_version/terrain/cpp_baseland.cpp
deleted file mode 100644
index 40573114bf..0000000000
--- a/old_d_version/terrain/cpp_baseland.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-class BaseLand
-{
-public:
-  BaseLand()
-  {
-    createMesh();
-  }
-
-  ~BaseLand()
-  {
-    destroyMesh();
-  }
-
-  // Repositions the mesh based on camera location
-  void update()
-  {
-    Ogre::Real vd = mCamera->getFarClipDistance();
-    // Recreate the mesh if the view distance has increased
-    if ( vd > mMeshDistance  )
-      {
-        destroyMesh();
-        createMesh();
-      }
-
-    Ogre::Vector3 p = mCamera->getDerivedPosition();
-    p.x -= ((int)p.x % CELL_WIDTH);
-    p.z -= ((int)p.z % CELL_WIDTH);
-
-    float h = (p.y + 2048)*2.0/CELL_WIDTH;
-    h *= h;
-
-    mNode->setPosition(p.x, -p.z, -32 -h);
-  }
-
-private:
-  void createMesh()
-  {
-    float vd = mCamera->getFarClipDistance();
-
-    mMeshDistance = vd;
-
-    vd = vd/CELL_WIDTH * 32;
-
-    mMat = Ogre::MaterialManager::getSingleton().
-      create("BaseLandMat",
-             Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
-
-    Ogre::TextureUnitState* us = mMat->getTechnique(0)->getPass(0)->createTextureUnitState("_land_default.dds");
-    us->setTextureScale(1.0f/vd,1.0f/vd);
-
-    mMat->getTechnique(0)->getPass(0)->setDepthBias(-1);
-
-    mObject = mSceneMgr->createManualObject("BaseLand");
-    mObject->begin("BaseLandMat", Ogre::RenderOperation::OT_TRIANGLE_LIST);
-
-    vd = mMeshDistance;
-
-    const int HEIGHT = -2048 - 10;
-
-    mObject->position(-vd,vd,HEIGHT);
-    mObject->textureCoord(0, 1);
-
-    mObject->position(-vd,-vd,HEIGHT);
-    mObject->textureCoord(0, 0);
-
-    mObject->position(vd,-vd,HEIGHT);
-    mObject->textureCoord(1, 0);
-
-    mObject->position(vd,vd,HEIGHT);
-    mObject->textureCoord(1, 1);
-
-    mObject->quad(0,1,2,3);
-
-    mObject->end();
-
-    mNode = g_rootTerrainNode->createChildSceneNode();
-    mNode->attachObject(mObject);
-  }
-
-  void destroyMesh()
-  {
-    mNode->detachAllObjects();
-    mSceneMgr->destroyManualObject(mObject);
-    mNode->getParentSceneNode()->removeAndDestroyChild(mNode->getName());
-
-    mMat->getCreator()->remove(mMat->getHandle());
-    mMat = Ogre::MaterialPtr();
-  }
-
-  ///the created mesh
-  Ogre::ManualObject* mObject;
-
-  ///The material for the mesh
-  Ogre::MaterialPtr mMat;
-
-  ///scene node for the mesh
-  Ogre::SceneNode* mNode;
-
-  ///In essence, the farViewDistance of the camera last frame
-  Ogre::Real mMeshDistance;
-};
diff --git a/old_d_version/terrain/cpp_mesh.cpp b/old_d_version/terrain/cpp_mesh.cpp
deleted file mode 100644
index f5f6a26f57..0000000000
--- a/old_d_version/terrain/cpp_mesh.cpp
+++ /dev/null
@@ -1,286 +0,0 @@
-// The Ogre renderable used to hold and display the terrain meshes.
-class TerrainMesh : public Ogre::Renderable, public Ogre::MovableObject
-{
-public:
-
-  TerrainMesh(Ogre::SceneNode *parent, const MeshInfo &info,
-              int level, float scale)
-    : Ogre::Renderable(),
-      Ogre::MovableObject()
-  {
-    TRACE("TerrainMesh()");
-
-    mLevel = level;
-
-    // This is a bit messy, with everything in one function. We could
-    // split it up later.
-
-    // Use MW coordinates all the way
-    assert(info.worldWidth > 0);
-    assert(info.minHeight <= info.maxHeight);
-    mBounds.setExtents(0,0,info.minHeight,
-                       info.worldWidth, info.worldWidth,
-                       info.maxHeight);
-    mCenter = mBounds.getCenter();
-    mBoundingRadius = mBounds.getHalfSize().length();
-
-    // TODO: VertexData has a clone() function. This probably means we
-    // can set this up once and then clone it, to get a completely
-    // unnoticable increase in performance :)
-    mVertices = new VertexData();
-    mVertices->vertexStart = 0;
-    mVertices->vertexCount = info.vertRows*info.vertCols;
-
-    VertexDeclaration* vertexDecl = mVertices->vertexDeclaration;
-    size_t currOffset = 0;
-
-    vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_POSITION);
-    currOffset += VertexElement::getTypeSize(VET_FLOAT3);
-
-    vertexDecl->addElement(0, currOffset, VET_FLOAT3, VES_NORMAL);
-    currOffset += VertexElement::getTypeSize(VET_FLOAT3);
-
-    vertexDecl->addElement(0, currOffset, VET_FLOAT2,
-                           VES_TEXTURE_COORDINATES, 0);
-    currOffset += VertexElement::getTypeSize(VET_FLOAT2);
-
-    assert(vertexDecl->getVertexSize(0) == currOffset);
-
-    HardwareVertexBufferSharedPtr mMainBuffer;
-    mMainBuffer = HardwareBufferManager::getSingleton().createVertexBuffer
-      (
-       vertexDecl->getVertexSize(0), // size of one whole vertex
-       mVertices->vertexCount,       // number of vertices
-       HardwareBuffer::HBU_STATIC_WRITE_ONLY, // usage
-       false); // no shadow buffer
-
-    // Bind the data
-    mVertices->vertexBufferBinding->setBinding(0, mMainBuffer);
-
-    // Fill the buffer
-    float* verts = static_cast<float*>
-      (mMainBuffer->lock(HardwareBuffer::HBL_DISCARD));
-    info.fillVertexBuffer(verts,8*mVertices->vertexCount);
-    mMainBuffer->unlock();
-
-    // Create the index data holder
-    mIndices = new IndexData();
-    mIndices->indexCount = 64*64*6; // TODO: Shouldn't be hard-coded
-    mIndices->indexBuffer =
-      HardwareBufferManager::getSingleton().createIndexBuffer
-      ( HardwareIndexBuffer::IT_16BIT,
-        mIndices->indexCount,
-        HardwareBuffer::HBU_STATIC_WRITE_ONLY,
-        false);
-
-    // Fill the buffer with warm fuzzy archive data
-    unsigned short* indices = static_cast<unsigned short*>
-      (mIndices->indexBuffer->lock
-       (0, mIndices->indexBuffer->getSizeInBytes(),
-        HardwareBuffer::HBL_DISCARD));
-    info.fillIndexBuffer(indices,mIndices->indexCount);
-    mIndices->indexBuffer->unlock();
-
-    // Finally, create the material
-    const std::string texName = info.getTexName();
-
-    // Set up the scene node.
-    mNode = parent->createChildSceneNode();
-    mNode->attachObject(this);
-
-    // Finally, create or retrieve the material
-    if(MaterialManager::getSingleton().resourceExists(texName))
-      {
-        mMaterial = MaterialManager::getSingleton().getByName
-          (texName);
-        return;
-      }
-
-    // No existing material. Create a new one.
-    mMaterial = MaterialManager::getSingleton().create
-      (texName, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
-
-    Pass* pass = mMaterial->getTechnique(0)->getPass(0);
-    pass->setLightingEnabled(false);
-
-    if(level > 1)
-      {
-        // This material just has a normal texture
-        pass->createTextureUnitState(texName)
-          //->setTextureAddressingMode(TextureUnitState::TAM_CLAMP)
-          ;
-      }
-    else
-      {
-        assert(level == 1);
-
-        // Get the background texture. TODO: We should get this from
-        // somewhere, no file names should be hard coded. The texture
-        // might exist as a .tga in earlier versions of the game, and
-        // we might also want to specify a different background
-        // texture on some meshes.
-        //const char *bgTex = info.getBackgroundTex();
-
-        const char *bgTex = "_land_default.dds";
-        pass->createTextureUnitState(bgTex)
-          ->setTextureScale(scale,scale);
-
-        // Loop through all the textures in this mesh
-        for(int tnum=0; tnum<info.alphaNum; tnum++)
-          {
-            const AlphaInfo &alpha = *info.getAlphaInfo(tnum);
-
-            // Name of the alpha map texture to create
-            std::string alphaName = alpha.getAlphaName();
-
-            // Name of the texture
-            std::string tname = alpha.getTexName();
-
-            // Create the alpha texture if it doesn't exist
-            if(!TextureManager::getSingleton().resourceExists(alphaName))
-              {
-                TexturePtr texPtr = Ogre::TextureManager::
-                  getSingleton().createManual
-                  (alphaName,
-                   Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
-                   Ogre::TEX_TYPE_2D,
-                   g_alphaSize,g_alphaSize,
-                   1,0, // depth, mipmaps
-                   Ogre::PF_A8, // One-channel alpha
-                   Ogre::TU_STATIC_WRITE_ONLY);
-
-                // Get the pointer
-                Ogre::HardwarePixelBufferSharedPtr pixelBuffer = texPtr->getBuffer();
-                pixelBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD);
-                const Ogre::PixelBox& pixelBox = pixelBuffer->getCurrentLock();
-                Ogre::uint8* pDest = static_cast<Ogre::uint8*>(pixelBox.data);
-
-                // Copy alpha data from file
-                alpha.fillAlphaBuffer(pDest,g_alphaSize*g_alphaSize);
-
-                // Close the buffer
-                pixelBuffer->unlock();
-              }
-
-            pass = mMaterial->getTechnique(0)->createPass();
-            pass->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
-            pass->setLightingEnabled(false);
-            pass->setDepthFunction(Ogre::CMPF_EQUAL);
-
-            Ogre::TextureUnitState* tus = pass->createTextureUnitState(alphaName);
-            //tus->setTextureAddressingMode(Ogre::TextureUnitState::TAM_CLAMP);
-
-            tus->setAlphaOperation(Ogre::LBX_BLEND_TEXTURE_ALPHA,
-                                   Ogre::LBS_TEXTURE,
-                                   Ogre::LBS_TEXTURE);
-            tus->setColourOperationEx(Ogre::LBX_BLEND_DIFFUSE_ALPHA,
-                                      Ogre::LBS_TEXTURE,
-                                      Ogre::LBS_TEXTURE);
-            tus->setIsAlpha(true);
-
-            // Add the actual texture on top of the alpha map.
-            tus = pass->createTextureUnitState(tname);
-            tus->setColourOperationEx(Ogre::LBX_BLEND_DIFFUSE_ALPHA,
-                                      Ogre::LBS_TEXTURE,
-                                      Ogre::LBS_CURRENT);
-
-            tus->setTextureScale(scale, scale);
-          }
-      }
-  }
-
-  ~TerrainMesh()
-  {
-    assert(mNode);
-    mNode->detachAllObjects();
-    mNode->getCreator()->destroySceneNode(mNode);
-
-    // TODO: This still crashes on level1 meshes. Find out why!
-    if(mLevel!=1)delete mVertices;
-    delete mIndices;
-  }
-
-  //-----------------------------------------------------------------------
-  // These are all Ogre functions that we have to override
-  //-----------------------------------------------------------------------
-
-  // Internal Ogre function. We should call visitor->visit on all
-  // Renderables that are part of this object. In our case, this is
-  // only ourselves.
-  void visitRenderables(Renderable::Visitor* visitor,
-                        bool debugRenderables = false) {
-    visitor->visit(this, 0, false);
-  }
-
-  void getRenderOperation( Ogre::RenderOperation& op ) {
-    op.useIndexes = true;
-    op.operationType = Ogre::RenderOperation::OT_TRIANGLE_LIST;
-    op.vertexData = mVertices;
-    op.indexData = mIndices;
-  }
-
-  void getWorldTransforms( Ogre::Matrix4* xform ) const {
-    *xform = mNode->_getFullTransform();
-  }
-
-  const Ogre::Quaternion& getWorldOrientation(void) const {
-    return mNode->_getDerivedOrientation();
-  }
-
-  const Ogre::Vector3& getWorldPosition(void) const {
-    return mNode->_getDerivedPosition();
-  }
-
-  Ogre::Real getSquaredViewDepth(const Ogre::Camera *cam) const {
-    Ogre::Vector3 diff = mCenter - cam->getDerivedPosition();
-    // Use squared length to avoid square root
-    return diff.squaredLength();
-  }
-
-  const Ogre::LightList& getLights(void) const {
-    if (mLightListDirty) {
-      getParentSceneNode()->getCreator()->_populateLightList
-        (mCenter, mBoundingRadius, mLightList);
-      mLightListDirty = false;
-    }
-    return mLightList;
-  }
-  virtual const Ogre::String& getMovableType( void ) const {
-    static Ogre::String t = "MW_TERRAIN";
-    return t;
-  }
-  void _updateRenderQueue( Ogre::RenderQueue* queue ) {
-    mLightListDirty = true;
-    queue->addRenderable(this, mRenderQueueID);
-  }
-  const Ogre::AxisAlignedBox& getBoundingBox( void ) const
-  {
-    return mBounds;
-  }
-
-  Ogre::Real getBoundingRadius(void) const {
-    return mBoundingRadius;
-  }
-  virtual const MaterialPtr& getMaterial(void) const
-  { return mMaterial; }
-
-  //-----------------------------------------------------------------------
-  //-----------------------------------------------------------------------
-
-private:
-
-  int mLevel;
-
-  Ogre::SceneNode* mNode;
-
-  Ogre::MaterialPtr mMaterial;
-
-  Ogre::VertexData* mVertices;
-  Ogre::IndexData* mIndices;
-
-  mutable bool mLightListDirty;
-
-  Ogre::Real mBoundingRadius;
-  Ogre::AxisAlignedBox mBounds;
-  Ogre::Vector3 mCenter;
-};
diff --git a/old_d_version/terrain/cpp_terrain.cpp b/old_d_version/terrain/cpp_terrain.cpp
deleted file mode 100644
index ad27110361..0000000000
--- a/old_d_version/terrain/cpp_terrain.cpp
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2009  Jacob Essex, Nicolay Korslund
-  WWW: http://openmw.sourceforge.net/
-
-  This file (cpp_terrain.cpp) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
-*/
-
-const int CELL_WIDTH = 8192;
-
-SceneNode *g_rootTerrainNode;
-int g_alphaSize;
-
-struct MeshInfo;
-struct AlphaInfo;
-
-// D functions
-extern "C"
-{
-  void d_terr_superman();
-  void d_terr_terrainUpdate();
-
-  char *d_terr_getTexName(int32_t);
-
-  void d_terr_fillVertexBuffer(const MeshInfo*,float*,uint64_t);
-  void d_terr_fillIndexBuffer(const MeshInfo*,uint16_t*,uint64_t);
-  AlphaInfo *d_terr_getAlphaInfo(const MeshInfo*,int32_t);
-
-  void d_terr_fillAlphaBuffer(const AlphaInfo*,uint8_t*,uint64_t);
-
-  int32_t d_terr_getAlphaSize();
-}
-
-// Info about a submesh. This is a clone of the struct defined in
-// archive.d. TODO: Make sure the D and C++ structs are of the same
-// size and alignment.
-struct MeshInfo
-{
-  // Bounding box info
-  float minHeight, maxHeight;
-  float worldWidth;
-
-  // Vertex and index numbers
-  int32_t vertRows, vertCols;
-
-  // Height offset to apply to all vertices
-  float heightOffset;
-
-  // Size and offset of the vertex buffer
-  int64_t vertBufSize, vertBufOffset;
-
-  // Texture name. Index to the string table.
-  int32_t texName;
-
-  // Number and offset of AlphaInfo blocks
-  int32_t alphaNum;
-  uint64_t alphaOffset;
-
-  inline void fillVertexBuffer(float *buffer, uint64_t size) const
-  {
-    d_terr_fillVertexBuffer(this, buffer, size);
-  }
-
-  inline void fillIndexBuffer(uint16_t *buffer, uint64_t size) const
-  {
-    d_terr_fillIndexBuffer(this, buffer, size);
-  }
-
-  inline char* getTexName() const
-  {
-    return d_terr_getTexName(texName);
-  }
-
-  inline AlphaInfo *getAlphaInfo(int tnum) const
-  {
-    return d_terr_getAlphaInfo(this, tnum);
-  }
-};
-
-// Info about an alpha map belonging to a mesh
-struct AlphaInfo
-{
-  // Position of the actual image data
-  uint64_t bufSize, bufOffset;
-
-  // The texture name for this layer. The actual string is stored in
-  // the archive's string buffer.
-  int32_t texName;
-  int32_t alphaName;
-
-  inline char* getTexName() const
-  {
-    return d_terr_getTexName(texName);
-  }
-
-  inline char* getAlphaName() const
-  {
-    return d_terr_getTexName(alphaName);
-  }
-
-  inline void fillAlphaBuffer(uint8_t *buffer, uint64_t size) const
-  {
-    return d_terr_fillAlphaBuffer(this, buffer, size);
-  }
-};
-
-#include "cpp_baseland.cpp"
-#include "cpp_mesh.cpp"
-
-BaseLand *g_baseLand;
-
-class TerrainFrameListener : public FrameListener
-{
-protected:
-  bool frameEnded(const FrameEvent& evt)
-  {
-    TRACE("Terrain frame");
-    d_terr_terrainUpdate();
-    if(g_baseLand)
-      g_baseLand->update();
-    return true;
-  }
-};
-
-// Renders a material into a texture
-Ogre::TexturePtr getRenderedTexture(Ogre::MaterialPtr mp,
-                                    const std::string& name,
-                                    int texSize, Ogre::PixelFormat tt)
-{
-  Ogre::CompositorPtr cp = Ogre::CompositorManager::getSingleton().
-    create("Rtt_Comp",
-           Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
-
-  Ogre::CompositionTargetPass* ctp = cp->createTechnique()->getOutputTargetPass();
-  Ogre::CompositionPass* cpass = ctp->createPass();
-  cpass->setType(Ogre::CompositionPass::PT_RENDERQUAD);
-  cpass->setMaterial(mp);
-
-  // Create the destination texture
-  Ogre::TexturePtr texture = Ogre::TextureManager::getSingleton().
-    createManual(name + "_T",
-                 Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
-                 Ogre::TEX_TYPE_2D,
-                 texSize,
-                 texSize,
-                 0,
-                 tt,
-                 Ogre::TU_RENDERTARGET
-                 );
-
-  Ogre::RenderTexture* renderTexture = texture->getBuffer()->getRenderTarget();
-  Ogre::Viewport* vp = renderTexture->addViewport(mCamera);
-
-  Ogre::CompositorManager::getSingleton().addCompositor(vp, "Rtt_Comp");
-  Ogre::CompositorManager::getSingleton().setCompositorEnabled(vp,"Rtt_Comp", true);
-
-  renderTexture->update();
-
-  // Call the OGRE renderer.
-  Ogre::Root::getSingleton().renderOneFrame();
-
-  Ogre::CompositorManager::getSingleton().removeCompositor(vp, "Rtt_Comp");
-  Ogre::CompositorManager::getSingleton().remove(cp->getHandle());
-
-  renderTexture->removeAllViewports();
-
-  return texture;
-}
-
-// These are used between some functions below. Kinda messy. Since
-// these are GLOBAL instances, they are terminated at program
-// exit. However, OGRE itself is terminated before that, so we have to
-// make sure we have no 'active' shared pointers after OGRE is
-// finished (otherwise we get a segfault at exit.)
-std::list<Ogre::ResourcePtr> createdResources;
-Ogre::HardwarePixelBuffer *pixelBuffer;
-MaterialPtr mat;
-
-// Functions called from D
-extern "C"
-{
-  SceneNode* terr_createChildNode(float x, float y,
-                                  SceneNode *parent)
-  {
-    Ogre::Vector3 pos(x,y,0);
-    if(parent == NULL)
-      parent = g_rootTerrainNode;
-
-    assert(parent);
-    return parent->createChildSceneNode(pos);
-  }
-
-  void terr_destroyNode(SceneNode *node)
-  {
-    node->removeAndDestroyAllChildren();
-    mSceneMgr->destroySceneNode(node);
-  }
-
-  // TODO: We could make allocation a little more refined than new and
-  // delete. But that's true for everything here. A freelist based
-  // approach is best in most of these cases, as we have continuous
-  // allocation/deallocation of fixed-size structs.
-  Ogre::AxisAlignedBox *terr_makeBounds(float minHeight, float maxHeight,
-                                        float width, SceneNode* node)
-  {
-    TRACE("terr_makeBounds");
-    AxisAlignedBox *mBounds = new AxisAlignedBox;
-
-    assert(maxHeight >= minHeight);
-
-    mBounds->setExtents(0,0,minHeight,
-                        width,width,maxHeight);
-
-    // Transform the box to world coordinates, so it can be compared
-    // with the camera later.
-    mBounds->transformAffine(node->_getFullTransform());
-
-    return mBounds;
-  }
-
-  void terr_killBounds(AxisAlignedBox *bounds)
-  {
-    TRACE("terr_killBounds");
-    delete bounds;
-  }
-
-  float terr_getSqCamDist(AxisAlignedBox *mBounds)
-  {
-    TRACE("terr_getSqCamDist");
-    Ogre::Vector3 cpos = mCamera->getDerivedPosition();
-    Ogre::Vector3 diff(0, 0, 0);
-    diff.makeFloor(cpos - mBounds->getMinimum() );
-    diff.makeCeil(cpos - mBounds->getMaximum() );
-    return diff.squaredLength();
-  }
-
-  TerrainMesh *terr_makeMesh(SceneNode *parent,
-                             MeshInfo *info,
-                             int level, float scale)
-  {
-    return new TerrainMesh(parent, *info, level, scale);
-  }
-
-  void terr_killMesh(TerrainMesh *mesh)
-  {
-    TRACE("terr_killMesh");
-    delete mesh;
-  }
-
-  // Set up the rendering system
-  void terr_setupRendering()
-  {
-    TRACE("terr_setupRendering()");
-    // Make sure the C++ sizes match the D sizes, since the structs
-    // are shared between the two.
-    assert(sizeof(MeshInfo) == 14*4);
-    assert(sizeof(AlphaInfo) == 6*4);
-
-    // Add the terrain directory as a resource location. TODO: Get the
-    // name from D.
-    ResourceGroupManager::getSingleton().
-      addResourceLocation("cache/terrain/", "FileSystem", "General");
-
-    // Enter superman mode
-    mCamera->setFarClipDistance(40*CELL_WIDTH);
-    //ogre_setFog(0.7, 0.7, 0.7, 200, 32*CELL_WIDTH);
-    d_terr_superman();
-
-    // Create a root scene node first. The 'root' node is rotated to
-    // match the MW coordinate system
-    g_rootTerrainNode = mwRoot->createChildSceneNode("TERRAIN_ROOT");
-
-    // Add the base land. This is the ground beneath the actual
-    // terrain mesh that makes the terrain look infinite.
-    //g_baseLand = new BaseLand();
-
-    g_alphaSize = d_terr_getAlphaSize();
-
-    // Add the frame listener
-    mRoot->addFrameListener(new TerrainFrameListener);
-  }
-
-  // The next four functions are called in the function genLevel2Map()
-  // only. This is very top-down-programming-ish and a bit messy, but
-  // that's what I get for mixing C++ and D like this.
-  void terr_makeLandMaterial(const char* name, float scale)
-  {
-    // Get a new material
-    mat = Ogre::MaterialManager::getSingleton().
-      create(name,
-             Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
-
-    // Put the default texture in the bottom 'layer', so that we don't
-    // end up seeing through the landscape.
-    Ogre::Pass* np = mat->getTechnique(0)->getPass(0);
-    np->setLightingEnabled(false);
-    np->createTextureUnitState("_land_default.dds")
-      ->setTextureScale(scale,scale);
-  }
-
-  uint8_t *terr_makeAlphaLayer(const char* name, int32_t width)
-  {
-    // Create alpha map for this texture.
-    Ogre::TexturePtr texPtr = Ogre::TextureManager::getSingleton().
-      createManual(name,
-                   Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
-                   Ogre::TEX_TYPE_2D,
-                   width, width,
-                   1,0, // depth, mipmaps
-                   Ogre::PF_A8, // One-channel alpha
-                   Ogre::TU_STATIC_WRITE_ONLY);
-
-    createdResources.push_back(texPtr);
-
-    pixelBuffer = texPtr->getBuffer().get();
-    pixelBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD);
-    const Ogre::PixelBox& pixelBox = pixelBuffer->getCurrentLock();
-
-    return static_cast<Ogre::uint8*>(pixelBox.data);
-  }
-
-  void terr_closeAlpha(const char *alphaName,
-                       const char *texName, float scale)
-  {
-    // Close the alpha pixel buffer opened in the previous function
-    pixelBuffer->unlock();
-
-    // Create a pass containing the alpha map
-    Pass *np = mat->getTechnique(0)->createPass();
-    np->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
-    np->setLightingEnabled(false);
-    np->setDepthFunction(Ogre::CMPF_EQUAL);
-    Ogre::TextureUnitState* tus = np->createTextureUnitState(alphaName);
-    tus->setTextureAddressingMode(Ogre::TextureUnitState::TAM_CLAMP);
-
-    // Set various blending options
-    tus->setAlphaOperation(Ogre::LBX_BLEND_TEXTURE_ALPHA,
-                           Ogre::LBS_TEXTURE,
-                           Ogre::LBS_TEXTURE);
-    tus->setColourOperationEx(Ogre::LBX_BLEND_DIFFUSE_ALPHA,
-                              Ogre::LBS_TEXTURE,
-                              Ogre::LBS_TEXTURE);
-    tus->setIsAlpha(true);
-
-    // Add the terrain texture to the pass and scale it.
-    tus = np->createTextureUnitState(texName);
-    tus->setColourOperationEx(Ogre::LBX_BLEND_DIFFUSE_ALPHA,
-                              Ogre::LBS_TEXTURE,
-                              Ogre::LBS_CURRENT);
-    tus->setTextureScale(scale, scale);
-  }
-
-  // Clean up after the above functions, render the material to
-  // texture and save the data in outdata and in the file outname.
-  void terr_cleanupAlpha(const char *outname,
-                         void *outData, int32_t toSize)
-  {
-    TexturePtr tex1 = getRenderedTexture(mat,outname,
-                                         toSize,Ogre::PF_R8G8B8);
-
-    // Blit the texture into the given memory buffer
-    PixelBox pb = PixelBox(toSize, toSize, 1, PF_R8G8B8);
-    pb.data = outData;
-    tex1->getBuffer()->blitToMemory(pb);
-
-    // Clean up
-    TextureManager::getSingleton().remove(tex1->getHandle());
-    const std::list<Ogre::ResourcePtr>::const_iterator iend = createdResources.end();
-    for ( std::list<Ogre::ResourcePtr>::const_iterator itr = createdResources.begin();
-          itr != iend;
-          ++itr)
-      (*itr)->getCreator()->remove((*itr)->getHandle());
-    createdResources.clear();
-
-    MaterialManager::getSingleton().remove(mat->getHandle());
-    mat.setNull();
-  }
-
-  void terr_resize(void* srcPtr, void* dstPtr, int32_t fromW, int32_t toW)
-  {
-    // Create pixelboxes
-    PixelBox src = PixelBox(fromW, fromW, 1, PF_R8G8B8);
-    PixelBox dst = PixelBox(toW,   toW,   1, PF_R8G8B8);
-
-    src.data = srcPtr;
-    dst.data = dstPtr;
-
-    // Resize the image. The nearest neighbour filter makes sure
-    // there is no blurring.
-    Image::scale(src, dst, Ogre::Image::FILTER_NEAREST);
-  }
-
-  void terr_saveImage(void *data, int32_t width, const char* name)
-  {
-    Image img;
-    img.loadDynamicImage((uchar*)data, width, width, PF_R8G8B8);
-    img.save(name);
-  }
-}
diff --git a/old_d_version/terrain/esmland.d b/old_d_version/terrain/esmland.d
deleted file mode 100644
index 1ea169ade5..0000000000
--- a/old_d_version/terrain/esmland.d
+++ /dev/null
@@ -1,158 +0,0 @@
-module terrain.esmland;
-
-import esm.loadltex;
-import esm.loadcell;
-import util.regions;
-import esm.filereader;
-
-import std.stdio;
-
-const int LAND_NUM_VERTS = 65*65;
-
-MWLand mwland;
-
-// Interface to the ESM landscape data
-struct MWLand
-{
-  RegionManager reg;
-
-  // These structs/types represent the way data is actually stored in
-  // the ESM files.
-
-  // Heightmap
-  align(1)
-  struct VHGT
-  {
-    float heightOffset;
-    byte  heightData[LAND_NUM_VERTS];
-    short unknown1;
-    char unknown2;
-  }
-
-  // Normals
-  typedef byte[LAND_NUM_VERTS*3] VNML;
-
-  // Land textures. This is organized in 4x4 buffers of 4x4 squares
-  // each. This is how the original engine splits up the cell meshes,
-  // and it's probably a good idea for us to do the same.
-  typedef short[4][4][4][4] VTEX;
-
-  static assert(VHGT.sizeof == 4232);
-  static assert(VNML.sizeof == 12675);
-  static assert(VTEX.sizeof == 512);
-
-  // Landscape data for one cell
-  struct LandData
-  {
-    VHGT vhgt;
-    VNML normals;
-  }
-
-  // Texture data for one cell
-  struct LTEXData
-  {
-    // Global list of land textures from the source ES file
-    LandTextureList.TextureList source;
-
-    // Texture indices for this cell
-    VTEX vtex;
-
-    // Get the texture x2,y2 from the sub map x1,x2
-    char[] getTexture(int x1, int y1, int x2, int y2)
-    {
-      // Get the texture index relative to the current esm/esp file
-      short texID = vtex[y1][x1][y2][x2] - 1;
-
-      if(texID == -1)
-        return null;
-
-      // Return the 'new' texture name. This name was automatically
-      // been converted to .dds at load time if the .tga file was not
-      // found.
-      assert(source !is null);
-      assert(texID >= 0 && texID < source.length);
-      return source[texID].getNewName();
-    }
-
-    // Get a texture from the 16x16 grid in one cell
-    char[] getTexture(int x, int y)
-    {
-      return getTexture(x/4,y/4,x%4,y%4);
-    }
-  }
-
-  // Get the maximum absolute coordinate value in any direction
-  int getMaxCoord()
-  { return cells.maxXY; }
-
-  // Does the given cell exist and does it have land data?
-  bool hasData(int x, int y)
-  {
-    // Does the cell exist?
-    if(!cells.hasExt(x,y))
-      return false;
-
-    // And does it have terrain data?
-    auto ex = cells.getExt(x,y);
-    return ex.hasLand();
-  }
-
-  LandData *getLandData(int x, int y)
-  {
-    loadCell(x, y);
-    return &currentLand;
-  }
-
-  LTEXData *getLTEXData(int x, int y)
-  {
-    loadCell(x, y);
-    return &currentLtex;
-  }
-
-  private:
-
-  int currentX = -1234;
-  int currentY = 4321;
-
-  LandData currentLand;
-  LTEXData currentLtex;
-
-  // Make sure the given cell is loaded
-  void loadCell(int x, int y)
-  {
-    // If the right cell is already loaded, don't do anything
-    if(x == currentX && y == currentY)
-      return;
-
-    assert(hasData(x,y));
-
-    currentX = x;
-    currentY = y;
-
-    // Get the file context for the terrain data. This can be used to
-    // skip to the right part of the ESM file.
-    auto cont = cells.getExt(x,y).land.context;
-
-    // Get the land texture list from the file
-    currentLtex.source = landTextures.files[cont.filename];
-
-    // We should use an existing region later, or at least delete this
-    // once we're done with the gen process.
-    if(reg is null)
-      reg = new RegionManager();
-
-    // Open the ESM at this cell
-    esFile.restoreContext(cont, reg);
-
-    // Store the cell-specific data
-    esFile.readHNExact(currentLand.normals.ptr,
-                       currentLand.normals.length, "VNML");
-    esFile.readHNExact(&currentLand.vhgt, VHGT.sizeof, "VHGT");
-
-    // These aren't used yet
-    if(esFile.isNextSub("WNAM")) esFile.skipHSubSize(81);
-    if(esFile.isNextSub("VCLR")) esFile.skipHSubSize(12675);
-
-    esFile.readHNExact(&currentLtex.vtex, VTEX.sizeof, "VTEX");
-  }
-}
diff --git a/old_d_version/terrain/generator.d b/old_d_version/terrain/generator.d
deleted file mode 100644
index f1645c9ab9..0000000000
--- a/old_d_version/terrain/generator.d
+++ /dev/null
@@ -1,1114 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008-2009  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (generator.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
-*/
-
-// This module is responsible for generating the cache files.
-module terrain.generator;
-
-import std.stdio;
-import std.string;
-import std.math2;
-import std.c.string;
-
-import terrain.cachewriter;
-import terrain.archive;
-import terrain.esmland;
-import terrain.terrain;
-import terrain.bindings;
-
-import util.cachefile;
-
-import monster.util.aa;
-import monster.util.string;
-import monster.vm.dbg;
-
-int mCount;
-
-// Texture sizes for the various levels. For the most detailed level
-// (level 1), this give the size of the alpha splatting textures rather
-// than a final texture.
-int[] texSizes;
-
-CacheWriter cache;
-
-void generate(char[] filename)
-{
-  makePath(cacheDir);
-
-  cache.openFile(filename);
-
-  // Find the maxiumum distance from (0,0) in any direction
-  int max = mwland.getMaxCoord();
-
-  // Round up to nearest power of 2
-  int depth=1;
-  while(max)
-    {
-      max >>= 1;
-      depth++;
-      assert(depth <= 8);
-    }
-  max = 1 << depth-1;
-
-  // We already know the answers
-  assert(max == 32);
-  assert(depth == 6);
-
-  // Set the texture sizes. TODO: These should be config options,
-  // perhaps - or maybe a result of some higher-level detail setting.
-  texSizes.length = depth+1;
-  texSizes[6] = 1024;
-  texSizes[5] = 512;
-  texSizes[4] = 256;
-  texSizes[3] = 256;
-  texSizes[2] = 512;
-  texSizes[1] = 64;
-
-  // Set some general parameters for the runtime
-  cache.setParams(depth+1, texSizes[1]);
-
-  // Create some common data first
-  writefln("Generating common data");
-  genDefaults();
-  genIndexData();
-
-  writefln("Generating quad data");
-  GenLevelResult gen;
-
-  // Start at one level above the top, but don't generate data for it
-  genLevel(depth+1, -max, -max, gen, false);
-
-  writefln("Writing index file");
-  cache.finish();
-  writefln("Pregeneration done. Results written to ", filename);
-}
-
-struct GenLevelResult
-{
-  QuadHolder quad;
-
-  bool hasMesh;
-  bool isAlpha;
-
-  int width;
-
-  ubyte[] data;
-
-  void allocImage(int _width)
-  {
-    assert(isEmpty());
-
-    width = _width;
-    data.length = width*width*3;
-    quad.meshes.length = 1;
-
-    assert(!hasAlpha());
-  }
-
-  void allocAlphas(int _width, int texNum)
-  {
-    assert(isEmpty() || hasMesh);
-
-    width = _width;
-    data.length = width*width*texNum;
-    isAlpha = true;
-
-    // Set up the alpha images. TODO: We have to split these over
-    // several meshes, but for now pretend that we're using only
-    // one.
-    assert(quad.meshes.length == 1);
-    quad.meshes[0].alphas.length = texNum;
-    assert(alphaNum() == texNum);
-
-    int s = width*width;
-    for(int i=0;i<texNum;i++)
-      quad.meshes[0].alphas[i].buffer = data[i*s..(i+1)*s];
-  }
-
-  // Get the height offset
-  float getHeight()
-  {
-    if(hasMesh)
-      {
-        assert(quad.meshes.length == 1);
-        return quad.meshes[0].info.heightOffset;
-      }
-    else
-      // The default mesh starts at 2048 = 256*8 units below water
-      // level.
-      return -256;
-  }
-
-  bool isEmpty()
-  {
-    return (data.length == 0) && !hasMesh;
-  }
-
-  bool hasAlpha()
-  {
-    assert(isAlpha == (quad.info.level==1));
-    return isAlpha;
-  }
-
-  int alphaNum()
-  {
-    assert(hasAlpha());
-    assert(quad.meshes.length == 1);
-    return quad.meshes[0].alphas.length;
-  }
-
-  int getAlphaTex(int alpha)
-  {
-    return quad.meshes[0].alphas[alpha].info.texName;
-  }
-
-  void setAlphaTex(int alpha, int index)
-  {
-    quad.meshes[0].alphas[alpha].info.texName = index;
-
-    // Create the alpha material name.
-    char[] aname =
-      "ALPHA_" ~ .toString(quad.info.cellX)
-      ~ "_" ~ .toString(quad.info.cellY)
-      ~ "_" ~ .toString(alpha)
-      ~ "_" ~ .toString(index);
-
-    quad.meshes[0].alphas[alpha].info.alphaName = cache.addString(aname);
-  }
-
-  void setTexName(char[] tex)
-  {
-    assert(!isEmpty());
-    assert(quad.meshes.length == 1);
-    quad.meshes[0].info.texName = cache.addString(tex);    
-  }
-
-  void save(char[] tex)
-  {
-    assert(!isEmpty());
-    assert(!hasAlpha());
-
-    // Store the filename in the cache, so the runtime can find the
-    // file
-    setTexName(tex);
-
-    tex = cacheDir ~ tex;
-
-    writefln("  Creating ", tex);
-
-    terr_saveImage(data.ptr, width, toStringz(tex));
-  }
-
-  // Calculate the texture name for this quad
-  char[] getPNGName(bool isDefault)
-  {
-    int X = quad.info.cellX;
-    int Y = quad.info.cellY;
-    int level = quad.info.level;
-
-    char[] outname = toString(level) ~ "_";
-
-    if(isDefault)
-      outname ~= "default";
-    else
-      outname ~= toString(X) ~ "_" ~ toString(Y);
-
-    outname ~= ".png";
-
-    return outname;
-  }
-
-  // Resize the image
-  void resize(int toSize)
-  {
-    assert(!isEmpty());
-    assert(!hasAlpha());
-
-    // Make sure we're scaling down, since we never gain anything by
-    // scaling up.
-    assert(toSize < width);
-
-    ubyte newBuf[] = new ubyte[toSize*toSize*3];
-
-    // Resize
-    terr_resize(data.ptr, newBuf.ptr, width, toSize);
-
-    // Replace the old buffer
-    delete data;
-    width = toSize;
-    data = newBuf;
-  }
-
-  void kill()
-  {
-    if(!isEmpty())
-      {
-        // This takes care of both normal image data and alpha maps.
-        delete data;
-
-        if(hasMesh)
-          delete quad.meshes[0].vertexBuffer;
-      }
-  }
-
-  void allocMesh(int size)
-  {
-    quad.meshes.length = 1;
-
-    MeshHolder *mh = &quad.meshes[0];
-    MeshInfo *mi = &mh.info;
-
-    mi.vertRows = size;
-    mi.vertCols = size;
-    // 2 height bytes + 3 normal components = 5 bytes per vertex.
-    mh.vertexBuffer = new byte[5*size*size];
-
-    hasMesh = true;
-  }
-}
-
-// Default textures
-GenLevelResult[] defaults;
-
-// Generates the default texture images "2_default.png" etc
-void genDefaults()
-{
-  scope auto _trc = new MTrace("genDefaults");
-
-  int size = texSizes.length-1;
-  defaults.length = size;
-
-  for(int i=1; i<size; i++)
-    defaults[i].quad.info.level = i;
-
-  // Sending null as the first parameter tells the function to only
-  // render the default background.
-  assert(size > 2);
-  genLevel2Map(null, defaults[2]);
-
-  for(int i=3; i<size; i++)
-    mergeMaps(null, defaults[i]);
-}
-
-// Generates common mesh information that's stored in the .index
-// file. This includes the x/y coordinates of meshes on each level,
-// the u/v texture coordinates, and the triangle index data.
-void genIndexData()
-{
-  scope auto _trc = new MTrace("genIndexData");
-
-  // FIXME: Do this at runtime.
-  for(int lev=1; lev<=6; lev++)
-    {
-      // Make a new buffer to store the data
-      int size = 65*65*4;
-      auto vertList = new float[size];
-      int index = 0;
-
-      // Find the vertex separation for this level. The vertices are
-      // 128 units apart in each cell (level 1), and for each level
-      // above that we double the distance. This gives 128 * 2^(lev-1)
-      // = 64*2^lev.
-      int vertSep = 64 << lev;
-
-      // Loop over all the vertices in the mesh.
-      for(int y=0; y<65; y++)
-        for(int x=0; x<65; x++)
-          {
-            // X and Y
-            vertList[index++] = x*vertSep;
-            vertList[index++] = y*vertSep;
-
-            // U and V (texture coordinates)
-            float u = x/64.0;
-            float v = y/64.0;
-            assert(u>=0&&v>=0);
-            assert(u<=1&&v<=1);
-    
-            vertList[index++] = u;
-            vertList[index++] = v;
-          }
-      assert(index == vertList.length);
-      // Store the buffer
-      cache.addVertexBuffer(lev,vertList);
-    }
-
-  // index stuff already ported
-}
-
-void genLevel(int level, int X, int Y, ref GenLevelResult result,
-              bool makeData = true)
-{
-  scope auto _trc = new MTrace(format("genLevel(%s,%s,%s)",level,X,Y));
-  result.quad.info.cellX = X;
-  result.quad.info.cellY = Y;
-  result.quad.info.level = level;
-  result.quad.info.worldWidth = 8192 << (level-1);
-
-  assert(result.isEmpty);
-
-  // Level 1 (most detailed) is handled differently from the
-  // other leves.
-  if(level == 1)
-    {
-      assert(makeData);
-
-      if(!mwland.hasData(X,Y))
-        // Oops, there's no data for this cell. Skip it.
-        return;
-
-      // The mesh is generated in pieces rather than as one part.
-      genLevel1Meshes(result);
-
-      // We also generate alpha maps instead of the actual textures.
-      genCellAlpha(result);
-
-      if(!result.isEmpty())
-        {
-          // Store the information we just created
-          assert(result.hasAlpha());
-          cache.writeQuad(result.quad);
-        }
-
-      return;
-    }
-  assert(level > 1);
-
-  // Number of cells along one side in each sub-quad (not in this
-  // quad)
-  int cells = 1 << (level-2);
-
-  // Call the sub-levels and store the result
-  GenLevelResult sub[4];
-  genLevel(level-1, X, Y, sub[0]);             // NW
-  genLevel(level-1, X+cells, Y, sub[1]);       // NE
-  genLevel(level-1, X, Y+cells, sub[2]);       // SW
-  genLevel(level-1, X+cells, Y+cells, sub[3]); // SE
-
-  // Make sure we deallocate everything when the function exists
-  scope(exit)
-    {
-      foreach(ref s; sub)
-        s.kill();
-    }
-
-  // Mark the sub-quads that have data
-  bool anyUsed = false;
-  for(int i=0;i<4;i++)
-    {
-      bool used = !sub[i].isEmpty();
-      result.quad.info.hasChild[i] = used;
-      anyUsed = anyUsed || used;
-    }
-
-  if(!anyUsed)
-    {
-      // If our children are empty, then we are also empty.
-      assert(result.isEmpty());
-      return;
-    }
-
-  if(makeData)
-    {
-      if(level == 2)
-        // For level==2, generate a new texture from the alpha maps.
-        genLevel2Map(sub, result);
-      else
-        // Level 3+, merge the images from the previous levels
-        mergeMaps(sub, result);
-
-      // Create the landscape mesh by merging the result from the
-      // children.
-      mergeMesh(sub, result);
-    }
-
-  // Store the result in the cache file
-  cache.writeQuad(result.quad);
-}
-
-// Generate mesh data for one cell
-void genLevel1Meshes(ref GenLevelResult res)
-{
-  // Constants
-  int intervals = 64;
-  int vertNum = intervals+1;
-  int vertSep = 128;
-
-  // Allocate the mesh buffer
-  res.allocMesh(vertNum);
-
-  int cellX = res.quad.info.cellX;
-  int cellY = res.quad.info.cellY;
-  assert(res.quad.info.level==1);
-
-  MeshHolder *mh = &res.quad.meshes[0];
-  MeshInfo *mi = &mh.info;
-
-  // Set some basic data
-  mi.worldWidth = vertSep*intervals;
-  assert(mi.worldWidth == 8192);
-
-  auto land = mwland.getLandData(cellX, cellY);
-
-  byte[] heightData = land.vhgt.heightData;
-  byte[] normals = land.normals;
-  mi.heightOffset = land.vhgt.heightOffset;
-
-  float max=-1000000.0;
-  float min=1000000.0;
-
-  byte[] verts = mh.vertexBuffer;
-  int index = 0;
-
-  // Loop over all the vertices in the mesh
-  float rowheight = mi.heightOffset;
-  float height;
-  for(int y=0; y<65; y++)
-    for(int x=0; x<65; x++)
-      {
-        // Offset of this vertex within the source buffer
-        int offs=y*65+x;
-
-        // The vertex data from the ESM
-        byte data = heightData[offs];
-
-        // Write the height value as a short (2 bytes)
-        *(cast(short*)&verts[index]) = data;
-        index+=2;
-
-        // Calculate the height here, even though we don't store
-        // it. We use it to find the min and max values.
-        if(x == 0)
-          {
-            // Set the height to the row height
-            height = rowheight;
-
-            // First value in each row adjusts the row height
-            rowheight += data;
-          }
-        // Adjust the accumulated height with the new data.
-        height += data;
-
-        // Calculate the min and max
-        max = height > max ? height : max;
-        min = height < min ? height : min;
-
-        // Store the normals
-        for(int k=0; k<3; k++)
-          verts[index++] = normals[offs*3+k];
-      }
-
-  // Make sure we wrote exactly the right amount of data
-  assert(index == verts.length);
-
-  // Store the min/max values
-  mi.minHeight = min * 8;
-  mi.maxHeight = max * 8;
-}
-
-// Generate the alpha splatting bitmap for one cell.
-void genCellAlpha(ref GenLevelResult res)
-{
-  scope auto _trc = new MTrace("genCellAlpha");
-
-  int cellX = res.quad.info.cellX;
-  int cellY = res.quad.info.cellY;
-  assert(res.quad.info.level == 1);
-
-  // Set the texture name - it's used internally as the material name
-  // at runtime.
-  assert(res.quad.meshes.length == 1);
-  res.setTexName("AMAT_"~toString(cellX)~"_"~toString(cellY));
-
-  // List of texture indices for this cell. A cell has 16x16 texture
-  // squares.
-  int ltex[16][16];
-
-  auto ltexData = mwland.getLTEXData(cellX, cellY);
-
-  // A map from the global texture index to the local index for this
-  // cell.
-  int[int] textureMap;
-
-  int texNum = 0; // Number of local indices
-
-  // Loop through all the textures in the cell and get the indices
-  bool isDef = true;
-  for(int ty = 0; ty < 16; ty++)
-    for(int tx = 0; tx < 16; tx++)
-      {
-        // Get the texture in a given cell
-        char[] textureName = ltexData.getTexture(tx,ty);
-
-        // If the default texture is used, skip it. The background
-        // texture covers it (for now - we might change that later.)
-        if(textureName == "")
-          {
-            ltex[ty][tx] = -1;
-            continue;
-          }
-
-        isDef = false;
-
-        // Store the global index
-        int index = cache.addTexture(textureName);
-        ltex[ty][tx] = index;
-
-        // Add the index to the map
-        if(!(index in textureMap))
-          textureMap[index] = texNum++;
-      }
-
-  assert(texNum == textureMap.length);
-
-  // If we only found default textures, exit now.
-  if(isDef)
-    return;
-
-  int imageRes = texSizes[1];
-  int dataSize = imageRes*imageRes;
-
-  // Number of alpha pixels per texture square
-  int pps = imageRes/16;
-
-  // Make sure there are at least as many alpha pixels as there are
-  // textures
-  assert(imageRes >= 16);
-  assert(imageRes%16 == 0);
-  assert(pps >= 1);
-  assert(texNum >= 1);
-
-  // Allocate the alpha images
-  res.allocAlphas(imageRes, texNum);
-  assert(res.hasAlpha() && !res.isEmpty());
-
-  // Write the indices to the result list
-  foreach(int global, int local; textureMap)
-    res.setAlphaTex(local, global);
-
-  ubyte *uptr = res.data.ptr;
-
-  // Loop over all textures again. This time, do alpha splatting.
-  for(int ty = 0; ty < 16; ty++)
-    for(int tx = 0; tx < 16; tx++)
-      {
-        // Get the global texture index for this square, if any.
-        int index = ltex[ty][tx];
-        if(index == -1)
-          continue;
-
-        // Get the local index
-        index = textureMap[index];
-
-        // Get the offset of this square
-        long offs = index*dataSize + pps*(ty*imageRes + tx);
-
-        // FIXME: Make real splatting later. This is just
-        // placeholder code.
-
-        // Set alphas to full for this square
-        for(int y=0; y<pps; y++)
-          for(int x=0; x<pps; x++)
-            {
-              long toffs = offs + imageRes*y + x;
-              assert(toffs < dataSize*texNum);
-              uptr[toffs] = 255;
-            }
-      }
-}
-
-// Generate a texture for level 2 from four alpha maps generated in
-// level 1.
-void genLevel2Map(GenLevelResult maps[], ref GenLevelResult res)
-{
-  int fromSize = texSizes[1];
-  int toSize = texSizes[2];
-
-  struct LtexList
-  {
-    int[4] inds;
-  }
-
-  // Create an overview of which texture is used where. The 'key' is
-  // the global texture index, the 'value' is the corresponding
-  // local indices in each of the four submaps.
-  HashTable!(int, LtexList) lmap;
-
-  if(maps.length) // An empty list means use the default texture
-    for(int mi=0;mi<4;mi++)
-      {
-        if(maps[mi].isEmpty())
-          continue;
-
-        assert(maps[mi].hasAlpha());
-        assert(maps[mi].width == fromSize);
-
-        for(int ltex=0;ltex<maps[mi].alphaNum();ltex++)
-          {
-            // Global index for this texture
-            int gIndex = maps[mi].getAlphaTex(ltex);
-
-            // Store it in the map.
-            LtexList *v;
-            if(lmap.insertEdit(gIndex, v))
-              // If a new value was inserted, set all the values to -1
-              v.inds[] = -1;
-
-            v.inds[mi] = ltex;
-          }
-      }
-
-  float scale = TEX_SCALE/2;
-
-  char[] materialName = "MAT" ~ toString(mCount++);
-
-  terr_makeLandMaterial(toStringz(materialName),scale);
-
-  // Loop through all our textures
-  if(maps.length)
-    foreach(int gIndex, LtexList inds; lmap)
-      {
-        char[] name = cache.getString(gIndex);
-
-        // Skip default image, if present
-        if ( name.iBegins("_land_default.") )
-          continue;
-
-        // Create a new alpha texture and get a pointer to the pixel
-        // data
-        char *alphaName = toStringz(materialName ~ "_A_" ~ name);
-        auto pDest = terr_makeAlphaLayer(alphaName, 2*fromSize);
-
-        // Fill in the alpha values. TODO: Do all this with slices instead.
-        memset(pDest, 0, 4*fromSize*fromSize);
-        for(int i=0;i<4;i++)
-          {
-            // Does this sub-image have this texture?
-            int index = inds.inds[i];
-            if(index == -1) continue;
-
-            assert(!maps[i].isEmpty());
-
-            // Find the right sub-texture in the alpha map
-            ubyte *from = maps[i].data.ptr +
-              (fromSize*fromSize)*index;
-
-            // Find the right destination pointer
-            int x = i%2;
-            int y = i/2;
-            ubyte *to = pDest + x*fromSize + y*fromSize*fromSize*2;
-
-            // Copy the rows one by one
-            for(int row = 0; row < fromSize; row++)
-              {
-                assert(to+fromSize <= pDest + 4*fromSize*fromSize);
-                memcpy(to, from, fromSize);
-                to += 2*fromSize;
-                from += fromSize;
-              }
-          }
-
-        terr_closeAlpha(alphaName, toStringz(name), scale);
-      }
-
-  // Create the result buffer
-  res.allocImage(toSize);
-
-  // Texture file name
-  char[] outname = res.getPNGName(maps.length == 0);
-
-  terr_cleanupAlpha(toStringz(outname), res.data.ptr, toSize);
-  res.save(outname);
-}
-
-void mergeMaps(GenLevelResult[] maps, ref GenLevelResult res)
-{
-  int level = res.quad.info.level;
-
-  assert(texSizes.length > level);
-  assert(level > 2);
-  int fromSize = texSizes[level-1];
-  int toSize = texSizes[level];
-
-  // Create a new image buffer large enough to hold the four
-  // sub textures
-  res.allocImage(fromSize*2);
-
-  // Add the four sub-textures
-  for(int mi=0;mi<4;mi++)
-    {
-      ubyte[] src;
-
-      // Use default texture if no source is present
-      if(maps.length == 0 || maps[mi].isEmpty())
-        src = defaults[level-1].data;
-      else
-        src = maps[mi].data;
-
-      assert(src.length == 3*fromSize*fromSize);
-
-      // Find the sub-part of the destination buffer to write to
-      int x = (mi%2) * fromSize;
-      int y = (mi/2) * fromSize;
-
-      // Copy the image into the new buffer
-      copyBox(src, res.data, fromSize, fromSize*2, x, y, 3);
-    }
-
-  // Resize image if necessary
-  if(toSize != 2*fromSize)
-    res.resize(toSize);
-
-  // Texture file name
-  char[] outname = res.getPNGName(maps.length == 0);
-
-  // Save the image
-  res.save(outname);
-}
-
-// Copy from one buffer into a sub-region of another buffer
-void copyBox(ubyte[] src, ubyte[] dst,
-             int srcWidth, int dstWidth,
-             int dstX, int dstY, int pixSize)
-{
-  int fskip = srcWidth * pixSize;
-  int tskip = dstWidth * pixSize;
-  int rows = srcWidth;
-  int rowSize = srcWidth*pixSize;
-
-  assert(src.length == pixSize*srcWidth*srcWidth);
-  assert(dst.length == pixSize*dstWidth*dstWidth);
-  assert(srcWidth <= dstWidth);
-  assert(dstX <= dstWidth-srcWidth && dstY <= dstWidth-srcWidth);
-
-  // Source and destination pointers
-  ubyte *from = src.ptr;
-  ubyte *to = dst.ptr + dstY*tskip + dstX*pixSize;
-
-  for(;rows>0;rows--)
-    {
-      memcpy(to, from, rowSize);
-      to += tskip;
-      from += fskip;
-    }
-}
-
-// Create the mesh for this level, by merging the meshes from the
-// previous levels.
-void mergeMesh(GenLevelResult[] sub, ref GenLevelResult res)
-{
-  // How much to shift various numbers to the left at this level
-  // (ie. multiply by 2^shift). The height at each vertex is
-  // multiplied by 8 in each cell to get the final value. However,
-  // when we're merging two cells (in each direction), we have to
-  // scale down all the height values by 2 in order to fit the result
-  // in one byte. This means multiplying the factor by 2 for each
-  // level above the cell level.
-  int shift = res.quad.info.level - 1;
-  assert(shift >= 1);
-  assert(sub.length == 4);
-
-  // Allocate the result buffer
-  res.allocMesh(65);
-
-  MeshHolder *mh = &res.quad.meshes[0];
-  MeshInfo *mi = &mh.info;
-
-  // Basic info
-  mi.worldWidth = 8192 << shift;
-
-  // Copy the mesh height from the top left mesh
-  mi.heightOffset = sub[0].getHeight();
-
-  // Output buffer
-  byte verts[] = mh.vertexBuffer;
-
-  // Bytes per vertex
-  const int VSIZE = 5;
-
-  // Used to calculate the max and min heights
-  float minh = 300000.0;
-  float maxh = -300000.0;
-
-  foreach(si, s; sub)
-    {
-      int SX = si % 2;
-      int SY = si / 2;
-
-      // Find the offset in the destination buffer
-      int dest = SX*32 + SY*65*32;
-      dest *= VSIZE;
-
-      void putValue(int val)
-        {
-          assert(val >= short.min && val <= short.max);
-          *(cast(short*)&verts[dest]) = val;
-          dest += 2;
-        }
-
-      if(s.hasMesh)
-        {
-          auto m = &s.quad.meshes[0];
-          auto i = &m.info;
-
-          minh = min(minh, i.minHeight);
-          maxh = max(maxh, i.maxHeight);
-
-          byte[] source = m.vertexBuffer;
-          int src = 0;
-
-          int getValue()
-            {
-              int s = *(cast(short*)&source[src]);
-              src += 2;
-              return s;
-            }
-
-          // Loop through all the vertices in the mesh
-          for(int y=0;y<33;y++)
-            {
-              // Skip the first row in the mesh if there was a mesh
-              // above us. We assume that the previously written row
-              // already has the correct information.
-              if(y==0 && SY != 0)
-                {
-                  src += 65*VSIZE;
-                  dest += 65*VSIZE;
-                  continue;
-                }
-
-              // Handle the first vertex of the row outside the
-              // loop.
-              int height = getValue();
-
-              // If this isn't the very first row, sum up two row
-              // heights and skip the first row.
-              if(y!=0)
-                {
-                  // Skip the rest of the row.
-                  src += 64*VSIZE + 3;
-
-                  // Add the second height
-                  height += getValue();
-                }
-
-              putValue(height);
-
-              // Copy the normal
-              verts[dest++] = source[src++];
-              verts[dest++] = source[src++];
-              verts[dest++] = source[src++];
-
-              // Loop through the remaining 64 vertices in this row,
-              // processing two at a time.
-              for(int x=0;x<32;x++)
-                {
-                  height = getValue();
-
-                  // Sum up the next two heights
-                  src += 3; // Skip normal
-                  height += getValue();
-
-                  // Set the height
-                  putValue(height);
-
-                  // Copy the normal
-                  verts[dest++] = source[src++];
-                  verts[dest++] = source[src++];
-                  verts[dest++] = source[src++];
-                }
-              // Skip to the next row
-              dest += 32*VSIZE;
-            }
-          assert(src == source.length);
-        }
-      else
-        {
-          minh = min(minh, -2048);
-          maxh = max(maxh, -2048);
-
-          // Set all the vertices to zero.
-          for(int y=0;y<33;y++)
-            {
-              if(y==0 && SY != 0)
-                {
-                  dest += 65*VSIZE;
-                  continue;
-                }
-
-              for(int x=0;x<33;x++)
-                {
-                  if(x==0 && SX != 0)
-                    {
-                      dest += VSIZE;
-                      continue;
-                    }
-
-                  // Zero height and vertical normal
-                  verts[dest++] = 0;
-                  verts[dest++] = 0;
-                  verts[dest++] = 0;
-                  verts[dest++] = 0;
-                  verts[dest++] = 0x7f;
-                }
-              // Skip to the next row
-              dest += 32*VSIZE;
-            }
-        }
-    }
-
-  mi.minHeight = minh;
-  mi.maxHeight = maxh;
-  assert(minh <= maxh);
-}
-
-// ------- OLD CODE - use these snippets later -------
-
-// About segments:
-/* NOTES for the gen-phase: Was:
-// This is pretty messy. Btw: 128*16 == 2048 ==
-// CELL_WIDTH/4
-// 65 points across one cell means 64 intervals, and 17 points
-
-// means 16=64/4 intervals. So IOW the number of verts when
-// dividing by D is (65-1)/D + 1 = 64/D+1, which means that D
-// should divide 64, that is, be a power of two < 64.
-
-addNewObject(Ogre::Vector3(x*16*128, 0, y*16*128), //pos
-17, //size
-false, //skirts
-0.25f, float(x)/4.0f, float(y)/4.0f);//quad seg location
-*/
-
-/* This was also declared in the original code, you'll need it
-   when creating the cache data
-
-   size_t vw = mWidth; // mWidth is 17 or 65
-   if ( mUseSkirts ) vw += 2; // skirts are used for level 2 and up
-   vertCount=vw*vw;
-*/
-
-/**
- * @brief fills the vertex buffer with data
- * @todo I don't think tex co-ords are right
- void calculateVertexValues()
- {
- int start = 0;
- int end = mWidth;
-
- if ( mUseSkirts )
- {
- --start;
- ++end;
- }
-
- for ( int y = start; y < end; y++ )
- for ( int x = start; x < end; x++ )
- {
- if ( y < 0 || y > (mWidth-1) || x < 0 || x > (mWidth-1) )
- {
- // These are the skirt vertices. 'Skirts' are simply a
- // wall at the edges of the mesh that goes straight down,
- // cutting off the posibility that you might see 'gaps'
- // between the meshes. Or at least I think that's the
- // intention.
-
- assert(mUseSkirts);
-
- // 1st coordinate
- if ( x < 0 )
- *verts++ = 0;
- else if ( x > (mWidth-1) )
- *verts++ = (mWidth-1)*getVertexSeperation();
- else
- *verts++ = x*getVertexSeperation();
-
- // 2nd coordinate
- *verts++ = -4096; //2048 below base sea floor height
-
- // 3rd coordinate
- if ( y < 0 )
- *verts++ = 0;
- else if ( y > (mWidth-1) )
- *verts++ = (mWidth-1)*getVertexSeperation();
- else
- *verts++ = y*getVertexSeperation();
-
- // No normals
- for ( Ogre::uint i = 0; i < 3; i++ )
- *verts++ = 0;
-
- // It shouldn't matter if these go over 1
- float u = (float)(x) / (mWidth-1);
- float v = (float)(y) / (mWidth-1);
- *verts++ = u;
- *verts++ = v;
- }
- else // Covered already
-
- void calculateIndexValues()
- {
- size_t vw = mWidth-1;
- if ( mUseSkirts ) vw += 2;
-
- const size_t indexCount = (vw)*(vw)*6;
-
- //need to manage allocation if not null
- assert(mIndices==0);
-
- // buffer was created here
-
- bool flag = false;
- Ogre::uint indNum = 0;
- for ( Ogre::uint y = 0; y < (vw); y+=1 ) {
- for ( Ogre::uint x = 0; x < (vw); x+=1 ) {
-
- const int line1 = y * (vw+1) + x;
- const int line2 = (y + 1) * (vw+1) + x;
-
- if ( flag ) {
- *indices++ = line1;
- *indices++ = line2;
- *indices++ = line1 + 1;
-
- *indices++ = line1 + 1;
- *indices++ = line2;
- *indices++ = line2 + 1;
- } else {
- *indices++ = line1;
- *indices++ = line2;
- *indices++ = line2 + 1;
-
- *indices++ = line1;
- *indices++ = line2 + 1;
- *indices++ = line1 + 1;
- }
- flag = !flag; //flip tris for next time
-
- indNum+=6;
- }
- flag = !flag; //flip tries for next row
- }
- assert(indNum==indexCount);
- //return mIndices;
- }
-*/
diff --git a/old_d_version/terrain/myfile.d b/old_d_version/terrain/myfile.d
deleted file mode 100644
index 15239ac2eb..0000000000
--- a/old_d_version/terrain/myfile.d
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2009  Nicolay Korslund
-  WWW: http://openmw.sourceforge.net/
-
-  This file (archive.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
-*/
-
-module terrain.myfile;
-
-import std.stream;
-import std.stdio;
-
-// Add a couple of helper functions to the file stream
-class MyFile : File
-{
-  this(string filename, FileMode mode = FileMode.In)
-    {
-      super(filename, mode);
-    }
-
-  void fill(T)(ref T t)
-    {
-      readExact(&t, T.sizeof);
-    }
-
-  void dump(T)(ref T t)
-    {
-      writeExact(&t, T.sizeof);
-    }
-
-  void fillArray(T)(T[] t)
-    {
-      readExact(t.ptr, t.length*T.sizeof);
-    }
-
-  void dumpArray(T)(T[] t)
-    {
-      writeExact(t.ptr, t.length*T.sizeof);
-    }
-
-  void readArray(T)(ref T[] arr)
-    {
-      int size;
-      read(size);
-      assert(size < 1024*1024 && size > 0);
-      arr = new T[size];
-      fillArray!(T)(arr);
-    }
-
-  void writeArray(T)(T[] t)
-    {
-      int size = t.length;
-      write(size);
-      dumpArray!(T)(t);
-    }
-}
diff --git a/old_d_version/terrain/outbuffer.d b/old_d_version/terrain/outbuffer.d
deleted file mode 100644
index c496a4787f..0000000000
--- a/old_d_version/terrain/outbuffer.d
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008-2009  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.sourceforge.net/
-
-  This file (outbuffer.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
- */
-
-/*
-  This files provides a simple buffer class used for writing the cache
-  files. It lets you 'write' data to a growing memory buffer and
-  allows you to change the written data after the fact (since it's
-  retained in memory.) When you're done, you can write the entire
-  buffer to a stream in one operation.
- */
-
-module terrain.outbuffer;
-
-import util.regions;
-import std.stream;
-
-class OutBuffer
-{
- private:
-  RegionManager reg;
-  long used;
-  void[][] buffers;
-
- public:
-  this()
-    {
-      reg = new RegionManager("Outbuf", 200*1024);
-    }
-
-  void reset()
-    {
-      if(buffers.length)
-        delete buffers;
-
-      reg.freeAll();
-      used = 0;
-      buffers = null;
-    }
-
-  // Write everyting to a stream as one buffer
-  void writeTo(Stream str)
-    {
-      foreach(void[] v; buffers)
-        str.writeExact(v.ptr, v.length);
-
-      reset();
-    }
-
-  // Get a pointer to a new block at least 'bytes' large, but don't
-  // add it to the list.
-  void[] reserve(size_t bytes)
-    { return reg.allocate(bytes); }
-
-  // Get a new block which is 'bytes' size large.
-  void[] add(size_t bytes)
-    {
-      void[] p = reserve(bytes);
-      add(p);
-      return p;
-    }
-
-  // Add an existing block to the write list
-  void add(void[] p)
-  {
-    buffers ~= p;
-    used += p.length;
-  }
-
-  T[] write(T)(size_t num)
-  {
-    return cast(T[])add(num * T.sizeof);
-  }
-
-  size_t size() { return used; }
-}
diff --git a/old_d_version/terrain/quad.d b/old_d_version/terrain/quad.d
deleted file mode 100644
index c68afc1ca1..0000000000
--- a/old_d_version/terrain/quad.d
+++ /dev/null
@@ -1,286 +0,0 @@
-module terrain.quad;
-
-import terrain.archive;
-import terrain.bindings;
-import std.stdio;
-import monster.vm.dbg;
-
-const int CELL_WIDTH = 8192;
-const float SPLIT_FACTOR = 0.5;
-const float UNSPLIT_FACTOR = 2.0;
-
-class Quad
-{
-  this(int cellX=0, int cellY=0, Quad parent = null)
-    {
-      scope auto _trc = new MTrace("Quad.this");
-
-      mCellX = cellX;
-      mCellY = cellY;
-
-      // Do we have a parent?
-      if(parent !is null)
-        {
-          mLevel = parent.mLevel-1;
-
-          // Coordinates relative to our parent
-          int relX = cellX - parent.mCellX;
-          int relY = cellY - parent.mCellY;
-
-          // The coordinates give the top left corner of the quad, or our
-          // relative coordinates within that should always be positive.
-          assert(relX >= 0);
-          assert(relY >= 0);
-
-          // Create a child scene node. The scene node position is given in
-          // world units, ie. CELL_WIDTH units per cell.
-          mNode = terr_createChildNode(relX*CELL_WIDTH,
-                                       relY*CELL_WIDTH,
-                                       parent.mNode);
-
-          // Get the archive data for this quad.
-          mInfo = g_archive.getQuad(mCellX,mCellY,mLevel);
-
-          // Set up the bounding box. Use MW coordinates all the
-          // way.
-          mBounds = terr_makeBounds(mInfo.minHeight,
-                                    mInfo.maxHeight,
-                                    mInfo.worldWidth,
-                                    mNode);
-
-          float radius = mInfo.boundingRadius;
-
-          mSplitDistance   = radius * SPLIT_FACTOR;
-          mUnsplitDistance = radius * UNSPLIT_FACTOR;
-
-          // Square the distances
-          mSplitDistance *= mSplitDistance;
-          mUnsplitDistance *= mUnsplitDistance;
-
-          if(mLevel == 1)
-            {
-              // Create the terrain and leave it there.
-              buildTerrain();
-              isStatic = true;
-            }
-        }
-      else
-        {
-          // No parent, this is the top-most quad. Get all the info from
-          // the archive.
-          mInfo = g_archive.rootQuad;
-          assert(mInfo);
-
-          mLevel = mInfo.level;
-          cellX = mCellX = mInfo.cellX;
-          cellY = mCellY = mInfo.cellY;
-
-          mNode = terr_createChildNode(cellX*CELL_WIDTH,
-                                       cellY*CELL_WIDTH,
-                                       null);
-
-          // Split up
-          split();
-
-          // The root can never be unsplit
-          isStatic = true;
-        }
-
-      assert(mLevel >= 1);
-      assert(mNode !is null);
-
-      // Update the terrain. This will create the mesh or children if
-      // necessary.
-      update();
-    }
-
-  ~this()
-    {
-      scope auto _trc = new MTrace("Quad.~this");
-
-      // TODO: We might rewrite the code so that the quads are never
-      // actually destroyed, just 'inactivated' by hiding their scene
-      // node. We only call update on our children if we don't have a
-      // mesh ourselves.
-      if(hasMesh)
-        destroyTerrain();
-      else if(hasChildren)
-        for (size_t i = 0; i < 4; i++)
-          delete mChildren[i];
-    
-      terr_destroyNode(mNode);
-      if(mBounds !is null)
-        terr_killBounds(mBounds);
-    }
-
-  // Remove the landscape for this quad, and create children.
-  void split()
-    {
-      scope auto _trc = new MTrace("split");
-      // Never split a static quad or a quad that already has children.
-      assert(!isStatic);
-      assert(!hasChildren);
-      assert(mLevel > 1);
-
-      if(hasMesh)
-        destroyTerrain();
-
-      // Find the cell width of our children
-      int cWidth = 1 << (mLevel-2);
-
-      // Create children
-      for ( size_t i = 0; i < 4; ++i )
-        {
-          if(!mInfo.hasChild[i])
-            continue;
-
-          // The cell coordinates for this child quad
-          int x = (i%2)*cWidth + mCellX;
-          int y = (i/2)*cWidth + mCellY;
-
-          mChildren[i] = new Quad(x,y,this);
-        }
-      hasChildren = true;
-    }
-
-  // Removes children and rebuilds terrain
-  void unsplit()
-    {
-      scope auto _trc = new MTrace("unsplit");
-      // Never unsplit the root quad
-      assert(mLevel < g_archive.rootQuad.level);
-      // Never unsplit a static or quad that isn't split.
-      assert(!isStatic);
-      assert(hasChildren);
-      assert(!hasMesh);
-
-      for( size_t i = 0; i < 4; i++ )
-        {
-          delete mChildren[i];
-          mChildren[i] = null;
-        }
-
-      buildTerrain();
-
-      hasChildren = false;
-    }
-
-  // Determines whether to split or unsplit the quad, and immediately
-  // does it.
-  void update()
-    {
-      scope auto _trc = new MTrace("Quad.update()");
-
-      // Static quads don't change
-      if(!isStatic)
-        {
-          assert(mUnsplitDistance > mSplitDistance);
-
-          // Get (squared) camera distance. TODO: shouldn't this just
-          // be a simple vector difference from the mesh center?
-          assert(mBounds !is null);
-          float camDist = terr_getSqCamDist(mBounds);
-
-          // No children?
-          if(!hasChildren)
-            {
-              // If we're close, split now.
-              if(camDist < mSplitDistance)
-                split();
-              else
-                {
-                  // We're not close, and don't have any children. Should we
-                  // built terrain?
-                  if(!hasMesh)
-                    buildTerrain();
-                  return;
-                }
-            }
-
-          // If we get here, we either had children when we entered,
-          // or we just performed a split.
-          assert(!hasMesh);
-          assert(hasChildren);
-
-          // If the camera is too far away, kill the children.
-          if(camDist > mUnsplitDistance)
-            {
-              unsplit();
-              return;
-            }
-        }
-      else if(!hasChildren)
-        return;
-
-      // We have children and we're happy about it. Update them too.
-      for(int i; i < 4; ++i)
-        {
-          Quad q = mChildren[i];
-          if(q !is null) q.update();
-        }
-    }
-
-  // Build the terrain for this quad
-  void buildTerrain()
-    {
-      scope auto _trc = new MTrace("buildTerrain");
-
-      assert(!hasMesh);
-      assert(!isStatic);
-
-      // Map the terrain data into memory.
-      assert(mInfo);
-      g_archive.mapQuad(mInfo);
-
-      // Create one mesh for each segment in the quad. TerrainMesh takes
-      // care of the loading.
-      meshList.length = mInfo.meshNum;
-      foreach(i, ref m; meshList)
-        {
-          MeshInfo *mi = g_archive.getMeshInfo(i);
-          m = terr_makeMesh(mNode, mi, mInfo.level, TEX_SCALE);
-        }
-
-      hasMesh = true;
-    }
-
-  void destroyTerrain()
-    {
-      scope auto _trc = new MTrace("destroyTerrain");
-
-      assert(hasMesh);
-
-      foreach(m; meshList)
-        terr_killMesh(m);
-
-      meshList[] = null;
-      hasMesh = false;
-    }
-
- private:
-
-  // List of meshes, if any. The meshes are C++ objects.
-  MeshObj meshList[];
-
-  // Scene node. All child quads are added to this.
-  SceneNode mNode;
-
-  // Bounding box, transformed to world coordinates. Used to calculate
-  // camera distance.
-  Bounds mBounds;
-
-  float mSplitDistance,mUnsplitDistance;
-
-  Quad mChildren[4];
-
-  // Contains the 'level' of this node. Level 1 is the closest and
-  // most detailed level
-  int mLevel;
-  int mCellX, mCellY;
-
-  QuadInfo *mInfo;
-
-  bool hasMesh;
-  bool hasChildren;
-  bool isStatic;    // Static quads are never split or unsplit
-}
diff --git a/old_d_version/terrain/terrain.d b/old_d_version/terrain/terrain.d
deleted file mode 100644
index 4bf03c87ba..0000000000
--- a/old_d_version/terrain/terrain.d
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-  OpenMW - The completely unofficial reimplementation of Morrowind
-  Copyright (C) 2008-2009  Nicolay Korslund
-  Email: < korslund@gmail.com >
-  WWW: http://openmw.snaptoad.com/
-
-  This file (terrain.d) is part of the OpenMW package.
-
-  OpenMW is distributed as free software: you can redistribute it
-  and/or modify it under the terms of the GNU General Public License
-  version 3, as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  version 3 along with this program. If not, see
-  http://www.gnu.org/licenses/ .
-
- */
-
-module terrain.terrain;
-
-import terrain.generator;
-import terrain.archive;
-import terrain.bindings;
-import terrain.quad;
-import std.file, std.stdio;
-
-char[] cacheDir = "cache/terrain/";
-
-// Enable this to render single terrain meshes instead of the entire
-// data set
-//debug=singleMesh;
-
-void initTerrain(bool doGen)
-{
-  char[] fname = cacheDir ~ "landscape.cache";
-
-  if(!exists(fname))
-    {
-      writefln("Cache file '%s' not found. Creating:",
-               fname);
-      doGen = true;
-    }
-
-  if(doGen)
-    generate(fname);
-
-  // Load the archive file
-  g_archive.openFile(fname);
-
-  terr_setupRendering();
-
-  debug(singleMesh)
-    {
-      int X = 22;
-      int Y = 0;
-      bool next = false;
-
-      void doQuad(int x, int y, int lev, int diffx, int diffy)
-        {
-          if(!g_archive.hasQuad(x,y,lev))
-            return;
-
-          diffx *= 8192;
-          diffy *= 8192;
-
-          auto node = terr_createChildNode(20000+diffx,-60000+diffy,null);
-          auto info = g_archive.getQuad(x,y,lev);
-          g_archive.mapQuad(info);
-          auto mi = g_archive.getMeshInfo(0);
-          terr_makeMesh(node, mi, info.level, TEX_SCALE);
-        }
-
-      doQuad(X,Y,1, 0,0);
-      doQuad(X+1,Y,1, 1,0);
-      doQuad(X,Y+1,1, 0,1);
-      doQuad(X+1,Y+1,1, 1,1);
-
-      doQuad(X + (next?2:0),Y,2, 2,0);
-
-      doQuad(20,Y,3, 0,2);
-    }
-  else
-    {
-      // Create the root quad
-      rootQuad = new Quad;
-    }
-}
-
-extern(C) void d_terr_terrainUpdate()
-{
-  debug(singleMesh) return;
-
-  // Update the root quad each frame.
-  assert(rootQuad !is null);
-  rootQuad.update();
-}
-
-Quad rootQuad;