most functionality in place, almost done