rewrote handle append entries for clarity