First (untested) iteration for #13