my first crack at the code