update implementation of code