basic patch implementation