minor fixes

added missing graphics library
minor code reformat