working but without wrong sequence