removed typecasts and minor stuff.