script for counter