Pretty inefficient way of doing this..