most of the logic built out