implementation of the assignment