FIX: changes suggested by @Daxter