got it running need to scrutnize output to verify correctness though