Fixed errors with implementation