-- Tested working till first sub solution, need some design changes