updated processing code to fix initialization bug