removed unnnecessary code and added some stuff