Code and documentation updated