reorganized

needs serious integration and refactoring