work in progress, adding many features and refactoring to a more robust class based model