Worked on Initial code.

Got it to trigger and return a useful value whilst cutting out the rest
of the crap