implementation of all exercises