Update main
Improve code