Modified to be more easy to understand.