finished functions and added test