Big changes + test program in main()