debugging cos sin table code