Implemented the functins