integrating with gui