added ndarry function and count function