move code to git bar clamp and little fixes