1. fix bug in computing SD;