Optimistic Algorithms