Created logic and defined methods