Replaced own code with Swing Timer