code (will add writeup tomorrow)