made into class, added fetch_row method