implemented patch and clone