Added Some Comments and removed unused code