First commit at 23072013

99% done, still needs some improvement.