spark code, for archiving sake