removed unnecessary codes. Added well explaining comments
solved bug created by fast clicking on more than one div by unbinding the click event when selected variable is set to one(any of the div is clicked)