Rebuilt using PDO and OOP