Following a tutorial from Pixelnest with some of my own additions