java2d: now clears screen each tick, fixed bug with loops