first pass at some code. sort of works. kinda.