added logic into methods