implemented PA1 of RepApp