Improve robustness and efficiency of ShoreFacePerceptor
Convert to long's to avoid rollover possibility
formatting