reordered variable inits and removed unused vars according to pedantic compilation messages