deleted duplicate code and unneeded coding convertion.