Pre-paint all the pieces before building the closet shelves to make touch-ups easier with fewer coats to build up at the end. Construct a square from the top and bottom (A) and two sides (B).