Linh Tran's homework 2 submission. I think it took me more than 4+ hours, but I was going back and forth to optimize my codes. I'd also like to redo the server() if I had more time. But all 22 tests passed. Please review.