got the code working