Update and make easier to understand