Working well. Now trying to make more flexible