finished code for dropdown