added rmhead and rmtail scripts