Made changes suggested by @paulweb515