First commit. Implement base logic
One major defect