need to find a more efficient way of doing this