got tests working again #613. they could still use code improvements