Not the easiest way but it works...