add quit function, fix Ic and Is functions