Broken code that does not work as expected (painting dots)