converted more functions, only a couple remaining