Created functions.php for function and moved countRows() function onto it