Solved Caterpiler problem