Changes from gprocopciuc

This is a rebase of pull reguest #4 - the content is basically the same.