Modify Function to accept ids