Merged Pavle's changes