correcting syntax and fixing compare