Half implementing code for issue #1