fixed -Wall -pedantic warnings