#13 done, but needs testing, bit of #14 as well