fixing bugs found by online judge