If you inherit a poorly documented legacy codebase, how do you go about understanding it and planning updates?