Edited

This is the fixed version to the best I could, over the weekend without
help anyway.