Pieces are now randomly downloaded

Also used a mutex in case of concurrency issues and better abstractize
the code