Added automatic slide counting