comments on the v0 algorithm and general code readability improvements