Added documentation, renamed some stuff.