finished all the methods, need to improve memory usage