integrated Kal's suggestions