Brutal hack job
Updated version