code for 3c, not working yet