added some code from tutorial. not sure what it does :/