Algorithm 7 | Scientific Reports