- major refactory
- test now works