Adding implementation and documentation