added the rest of the bits and structured it some more