Some minor changes + added documentation.