Some progress on dialog boxes, works ok but not dynamic enough