Rewrote using OOP