minor change on err msg
changed function signatures after friday's meeting
changed signature after ffriday's meeting