Changes made by @jmnybl