Turn script into module
Use generator instead of list for finding course