Did some Sql and command stuff