Fixed most type error, still need to figure out what to do about top