added cylinder detection