Implemented filament detection