Simplified main
Final changes