Created a cleaner python function for each kernel