(And also added interfaces and rearranged some code to hopefully make it easier to read.)
Attach a file by drag & drop or click to upload