fixes #1, makes some progress for #2