main function working , but code as of now is very untidy : print function not working