Resolved thread issues - trying to integrate into gui