cleaned a bit the code and redid the output