Changed sleep method, some import corrections