Basic if statement to toggle play and puase functions