Wash the beans and soak overnight in the water. When the beans swell, cook in the same water until soft, about 45 minutes. Heat 1 cup oil in a frying pan, add onions, garlic and green peppers. Add 1 cup of the beans to the pan and mash. Add this to the beans together with the salt, pepper, if using, oregano, bay leaves and sugar. Allow to boil for a 1 hour then add the wine and vinegar allowing to cook uncovered for a while. Add the 4 remaining tablespoons olive oil just before serving.