simpler as recommended by @bloodyowl