Created relative spiral function and fixed some errors