implements and closes #17