Updated, to make it work on the current settings