Algorithm 6 | Scientific Reports