First buggy multithreaded version