someone else's code. sort of works. linking error