iImplemented all functions