fixed bug with iostream include and cleanup