simpler version
removes garbage