My code for gswd