Crap code from an unproductive day