Updated function to have keyword args for database and table