Improved documentation and fixed bugs with x factor treatment