Upload of first working version, still buggy and incomplete.