Added spin function