implemented the basic functionality