got rid of r/w function for simpler separate fn's