Made most of the changes, but didn't run it. Please check & fix anything necessary :)