Copypasted spin(); edited a few functions