Added whole process to single function to test