Finished, I think, need to debug if necessary