Working version, needs love and attention still, but ready to test out
on app.