Some code clean up, removed unused sigmoid_sample function