added variable handling and perf test