updated to make it easier to put in sql