finished prob5
modified global variables and prime-related functions
background stuff