Second attempt at getting this work as it should