naive implementation need improved padding function in particular