Solution needed for counting pulse inputs WITHOUT using Intterupts