kind of followed the tut but with some of my own stuff added