Almost done, need to add more error checking