Undid previous hacks, slight cleanup