this should work, basically just copied from my MSE760/project directory (on Odie)