Changed if else to case if and added a scrCounter function