updated game controller to handle mulitple materials