tried to implement a*