Updated code and scripts