Start working on average patch algoritm