adding new matrix replication code
Merge branch 'master' of https://github.com/gingsmith/ALS_debug