Added feature to set paint objects and dim value.
Added comments.