Finished the functionality...needs ton of cleanup