applied proper scalar replacement