fixed compilation error and minor formating