trying to make this thing a little smarter