* cleaned up code from pull request