updated with MSQL Code