almost adding most functionality