Seems like everything is working, now just have to let program know when to finish