removed unnecessary code and parameters to simplify.