bg added + code cleaning
Merged Illya's changes.