Finished all the logic stuff