Repair and Wood Finishing

I don't know why this piece was missing on top of the stairway, but with some wood finishing and painting it looks as good as new. Before and After