(merge with Stanford repo and improve the configure script)