added junit testing functionality