implemented the first few functions