Added select for difficulties and restructured functions