Got rid of unecessary code
updated code