Rewrote from scratch with more robust model and unit tests