First draft of function to apply committed log entries