Simplified main, removed Appendix