Fixed merge with Arnolds code