Updated code and documentation