Implemented a bunch of Tanya's suggestions.