added all functions;not tested