Added more documentation. Moved some parameters around and added stuff like callback and debug.