Successfully tested prime function