All changes belong to sttodorov!!!!!!

Code copied due to conflict.