work on the main script logic