fixes and improvements, magic