implements the code