Reviewed and added functions from adamv/dotfiles.