Implemented chinsky's suggestions.