Added documentation for everything, minor fixes here and there.