wrote in more of oop structure