erased main function

write a working main function