moved spin functions away