Added user defined variables & other improvements