trying to implement corners algo