updated code for sql commands and took out some debugging