replace constants with variables