fixed bug involving order of operations of <<; full test program now works