padded code, done right