Made changes recommended by takluyver