implemented remaining functions