Moved code and fixed error on arithmetic expressions