Tried to make the code readable.