Simplified main code