java lab middle term works