Initial proof of concept working. Needs further refinement