issues 3, 10 and 12 fixed