Will and John each have an mp3 player. The ratio of Will's songs to John's songs was 9:4. When Will accidentally erased 77 songs from his mp3 player, John had twice as many songs as his friend. How many songs did Will have at first?

w/j = 9/4

2(w-77) = j
so
2(w-77) = 4/9 w
solve for w