[WIP] Added some changes that were suggested in the first commit of this branch.