refactoring, added operator overloading