changed read and insert method, left some debug comments