added count8 and factorial