Initial model implementation
user system and bug fixes