Changed code 

This closes #91