Updated based on comments from @astrofrog and @jiffyclub