few bugs corrected due to query changes, and some analysis added