\functionally working

Needs refactoring