Updated puzzle logic to create multiple threads and work together
Added in functiionality for multiple threads and logic for all, and added locking and optimization