added documentation and code formating
fixed conflict