Compacted the code to what is needed. Add examples and functions to models etc.