pthread stuff implemented but no faster than single threaded