I have taken on a project that has for the most part been built, but it is buggy and has no requirements, scope, or technical specification docs. In your experience, what is the best way to go about building a specification from an existing system, all while sorting out bugs?