In a local bookstore, two types of books are being sold: fiction books at a price of $$p$$ dollars each and non-fiction books at a price of $$q$$ dollars each. A customer buys a total of 20 books and spends a total of 160 dollars. Additionally, the number of non-fiction books purchased is twice the number of fiction books purchased.
Let $$x$$ represent the number of fiction books purchased and $$y$$ the number of non-fiction books purchased. The situation can be modeled by the following system of equations:
1) $$x + y = 20$$
2) $$y = 2x$$
What is the value of $$x$$?