Algorithm 4.3 | Scientific Reports