Vincent's code for issue #60
Code for issue #64