changed the sql script a bit