updated master sql script