replaced sed and tr commands with variables