Added code and documentation