improved and edited A9.