fixed serializing, removed main() and instead initialized serialize var