Merge pull request #2 from timflutre/master

keep rank of X when fitting model
Merge pull request #3 from timflutre/master

improve includes of headers