classes with methods, code is self-explanatory