Algorithm 3 | Scientific Reports