Describe a time when you had to work with legacy code. How did you approach understanding and modifying it?