clearly I was half asleep when I wrote this, due to having used that function two lines above :P