Updated patch

Simplified code