Removed unused codes and code improved