I have betrayed the art of writing general functions but its been a productive day