Modified Laodshedder as per Chato's suggestions