cleaned up creation of hinges in create_hinges function
cleaned up creation of hinges in create_hinges function