Updated function for finding possible courses