Updated code to reflect Miguel's GitHub changes