cleaned up patch