Extra feature implemented!!!! Still need to fix the repaint bug and do
some refactoring.