Changed model structure.
Adding documentation.