overhaul; v1.0 almost complete