Added step parameter to scan cleaning function