implemented all remainign functionality