Adding sgdlib and testing