implements and closes #42