personalized code and added tests