Fixed errors and removed function

Fixed errors and removed function