removed unused code and updated version