Optimization and multithreading written by n1luik
Fix issues related to the biolith code in version 1.21