Nikhil revised code for bias term
Touch ups to Nikhil's revision