logging and restructuring the code from main to createslides js