coalesce code for computing sentiment