added the possibility to change the color of corners, some code tweaks