added StreamReader and made standard functions