Updated with suggestions from @JulianLeviston