Added threshold, bug fixing and alignment reporting