This is just a very basic implementation of the algorithm, just to test and for me to understand it better, next commit I'm gonna implement the last version of it with variable density