some minor changes and added OnItemClickListener