Better implementation 2