format the code style and update index_of_machine function logic