This code is sloppy and needs to eventually be worked on.