Initial solution

First rough solution , will push more descriptive solution afterwards