Added latest modifications by Zabojad