added some more bells and whistles to remove warnings