First commit. All functions work. More documentation needed.