refactored, fixed #2