New function - countdirs
Added count dirs, bettered script