fixed evaluate to work with variables. fixed replace to work with numbers.