Common algorithm coded by scala