Almost finished doc. Added casting for buttons.