Expanded qc code and added more documentation