adding in ruby line at top, fixing global variables