Updated with suggestions from @rolandwalker